Boost logo

Boost :

Subject: Re: [boost] Working around bogus -Wmaybe-uninitialized with boost::optional (was: [review][beast] Review of Beast starts today : July 1 - July 10)
From: Vadim Zeitlin (vz-boost_at_[hidden])
Date: 2017-07-09 17:09:35


On Sun, 9 Jul 2017 09:55:22 -0700 Vinnie Falco via Boost <boost_at_[hidden]> wrote:

VFvB> 1. The one in <beast/zlib/*> is a header-only port of zlib to
VFvB> modern-ish C++11. There is a warning "‘*((void*)& old_flush +4)’ may
...
VFvB> For #1 The variable is not used uninitialized, I believe it is a false
VFvB> positive cause by the implementation of boost::optional. I have spent
VFvB> a lot of time trying to fix this, to no avail - if someone smarter
VFvB> than me can offer a patch I would be grateful.

 There is a workaround mentioned at

http://www.boost.org/doc/libs/1_64_0/libs/optional/doc/html/boost_optional/tutorial/gotchas/false_positive_with__wmaybe_uninitialized.html

 Otherwise you can just use gcc pragmas to suppress this warning locally, I
don't think there is anything else to do (FWIW this issue is tracked in
https://svn.boost.org/trac10/ticket/12513)

 Regards,
VZ




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