lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Upgrading to gcc-4.9.2


From: Vadim Zeitlin
Subject: Re: [lmi] Upgrading to gcc-4.9.2
Date: Thu, 17 Dec 2015 17:54:58 +0100

On Thu, 17 Dec 2015 15:39:25 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2015-12-17 02:28, Greg Chicares wrote:
GC> [...]
GC> > In file included from /opt/lmi/local/include/wx/pdfdocument.h:25:0,
GC> >                  from /opt/lmi/local/include/wx/pdfdc.h:21,
GC> >                  from /lmi/src/lmi/group_quote_pdf_gen_wx.cpp:56:
GC> > /opt/lmi/local/include/wx/pdfarraytypes.h:27:86: error: invoking macro 
WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY argument 4: empty macro arguments are 
undefined in ISO C90 and ISO C++98
GC> >  WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_INT(int, wxPdfSortedArrayInt, 
WXDLLIMPEXP_PDFDOC);
GC> 
GC> This seems to go away with '-std=c++11'.

 Which is certainly the right compiler option to use in 2016.

GC> $sed -f diagnostics.sed ../log |grep 'error:' | sed 
-e's/^[^[]*\([[].*$\)/\1/' |sort |uniq -c |sort -nr
GC> 
GC>    1950 [-Werror=unused-local-typedefs]
GC>     517 [-Werror=conversion]
GC>     274 [-Werror=parentheses]
GC>      24 [-Werror=unused-variable]
GC>      23 [-Werror=float-conversion]
GC>       8 [-Werror=deprecated-declarations]
GC>       1 [-Werror=attributes]
GC> 
GC> I guess we'll reluctantly have to turn some of those warnings off
GC> because they occur in 'boost' headers...unless we can replace those
GC> headers with compiler-provided equivalents, or upgrade to a later
GC> version of boost that compiles without warnings. Specifically:
GC> 
GC>  -Wno-unused-local-typedefs
GC> 
GC> /opt/lmi/third_party/include/boost/static_assert.hpp:105:21: error: \
GC> typedef ‘boost_static_assert_typedef_108’ locally defined but not \
GC> used [-Werror=unused-local-typedefs]
GC>           BOOST_JOIN(boost_static_assert_typedef_, __LINE__)

 This one is fixed in the latest Boost (I know because it occurs in all
projects using Boost and I was sick and tired of seeing it).

GC>  -Wno-conversion
GC> 
GC> /opt/lmi/third_party/include/boost/mpl/aux_/integral_wrapper.hpp:73:96: 
error: \
GC> the result of the conversion is unspecified because ‘-1’ is outside the 
range of \
GC> type ‘boost::numeric::int_float_mixture_enum’ [-Werror=conversion]
GC> 
GC>  -Wno-unused-variable
GC> 
GC> /opt/lmi/third_party/include/boost/bind/placeholders.hpp:56:15: error: \
GC> ‘{anonymous}::_3’ defined but not used [-Werror=unused-variable]
GC> 
GC>  boost::arg<3> _3;

 I don't know about those but I can test.

GC>  -Wno-deprecated-declarations
GC> 
GC> /opt/lmi/third_party/src/libxml/node.cxx:284:33: error: \
GC> ‘auto_ptr’ is deprecated (declared at 
/usr/lib/gcc/i686-w64-mingw32/4.9.2/include/c++/backward/auto_ptr.h:87)\
GC>  [-Werror=deprecated-declarations]
GC>      std::auto_ptr<node_impl> ap(pimpl_ = new node_impl);
GC> 
GC> Perhaps Vaclav has changed xmlwrapp.

 No, but the change to (conditionally) use std::unique_ptr<> should be
simple enough, I can do it.

GC>  -Wno-parentheses
GC> 
GC> /lmi/src/lmi/value_cast.hpp:206:13: error: suggest parentheses around ‘&&’ 
within ‘||’ \
GC> [-Werror=parentheses]
GC> 
GC> This warning might be just noise. Here's the code:
GC> 
GC>     enum
GC>         {
GC>         one_numeric_one_string =
GC>                 boost::is_arithmetic<From>::value && is_string<To  >::value
GC>             ||  boost::is_arithmetic<To  >::value && is_string<From>::value
GC>         };
GC> 
GC> It seems to warn against
GC>   a && b || c && d
GC> but allow
GC>   a * b + c * d
GC> and I think both are reasonable and should be accepted without any warning.

 I think both are reasonable but I also think it's simpler to add the
parentheses to shut up the overbearing compiler rather than to spend time
on examining each warning it gives in details and then spend even more time
thinking about whether it's a good idea to disable it globally.

 Regards,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]