Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-06-10 12:56:45


Phil Richards wrote:
> In CVS boost/iostreams/filter/zlib.hpp, revision 1.21 there is:
>
> ...
> struct zlib_params {
>
> // Non-explicit constructor.
> zlib_params( int level = zlib::default_compression,
> int method = zlib::deflated,
> int window_bits = zlib::default_window_bits,
> int mem_level = zlib::default_mem_level,
> int strategy = zlib::default_strategy,
> bool noheader = zlib::default_noheader,
> bool calculate_crc = zlib::default_crc )
> : level(level), method(method), window_bits(window_bits),
> mem_level(mem_level), strategy(strategy),
> noheader(noheader), calculate_crc(zlib::default_crc)
> { }
> ...
>
> g++ -Wall -W (correctly) states:
> .../boost/iostreams/filter/zlib.hpp:120:
> warning: unused parameter 'calculate_crc'
>
> Normally I wouldn't worry about trivial warnings, but in this case
> the argument is being ignored when initialising the member data
> which looks a bit odd to me...

Yes, it is a bit odd, so I fixed the initialization to use the supplied value.
It doesn't affect the ordinary use of zlib or gzip, however, since plain zlib
users don't use the crc most of the time and gzip sets the calculate_crc flag
explicitly.

Thanks for the report.

> phil

Jonathan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk