From 33e0e5ee1bed56370a17d7774f5a5c8602fb435d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 24 Jun 2017 19:42:37 -0600 Subject: [PATCH] Suppress a warning. The compiler warns about the line header_ += gzip::magic::id2; // ID2. deep in BOOST when writing the header for a gzip-compressed block of data. This is because (i) gzip::magic::id2 is declared as an int, and (ii) has a value greater than what a *signed char* can store, i.e., greater than 127. Furthermore, std::string::operator+ takes a 'char', which may or may not be unsigned but apparently on my system is signed. So we get a warning about overflow. The only reasonable way to deal with this is to do the casting explicitly. --- bundled/boost-1.62.0/include/boost/iostreams/filter/gzip.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundled/boost-1.62.0/include/boost/iostreams/filter/gzip.hpp b/bundled/boost-1.62.0/include/boost/iostreams/filter/gzip.hpp index a0cc92c09b..f1dc9650c7 100644 --- a/bundled/boost-1.62.0/include/boost/iostreams/filter/gzip.hpp +++ b/bundled/boost-1.62.0/include/boost/iostreams/filter/gzip.hpp @@ -670,8 +670,8 @@ basic_gzip_compressor::basic_gzip_compressor gzip::extra_flags::best_speed : 0 ); header_.reserve(length); - header_ += gzip::magic::id1; // ID1. - header_ += gzip::magic::id2; // ID2. + header_ += char(gzip::magic::id1); // ID1. + header_ += char(gzip::magic::id2); // ID2. header_ += gzip::method::deflate; // CM. header_ += static_cast(flags); // FLG. header_ += static_cast(0xFF & p.mtime); // MTIME. -- 2.39.5