[Developers] g++ warning: operation on *bla* may be undefined

Tom Goodale goodale at cct.lsu.edu
Thu Oct 26 09:56:15 CDT 2006


On Thu, 26 Oct 2006, Jonathan Thornburg wrote:

> Hi,
>
> On Thu, 26 Oct 2006, Erik Schnetter wrote:
>
> IMHO Erik's suggestion of using  __attribute__((unused))  is the right
> way to solve this problem, while our current approach of trying to fool
> compilers is a chronic hassle which is gradually getting less effective
> as compilers get smarter.

I agree, although we need to maintain the kludges for compilers without 
the attribute mechanism.  So it looks like we should revert to the old 
mechanism (i.e. before today) but then add the infrastructure to detect 
and use compiler-specific attribute mechanisms where available.  This 
should give us a working solution for all current compilers and some 
infrastructure to hopefully take us into the future.

Tom


More information about the Developers mailing list