bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib bugs on OSX & C++


From: Bruno Haible
Subject: Re: gnulib bugs on OSX & C++
Date: Sun, 25 Apr 2010 00:59:17 +0200
User-agent: KMail/1.9.9

Jarno Rajahalme wrote:
> These warnings only show with -O, so this is related to optimization.
> 
> I have included the preprocessed output (main.cpp).
> 
> Compiled with:
> g++-mp-4.4 -DHAVE_CONFIG_H -I.. -I../lib -O1 -E -dD -c -o main.cpp main.cc

Thanks. I've reduced this to a test case and reported it as a GCC bug:
  <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>

There are three possible ways to handle this:
  a) Change the initializer from ::func to ((void)0,::func).
     This has the effect of getting rid of the warning, but creates lots of
     initialized variables in the 'data' segment, for every compilation unit.
     I.e. it bloats the compiled code.
  b) Change the warning to be enabled when !__OPTIMIZE__. This means that
     with default optimization flags (-O2 -g), no warnings will be visible.
  c) Leave it as it, and document that users should look at the warnings only
     with -O0.

I'm not sure which one you prefer?

Bruno




reply via email to

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