This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Switch -Wunused-variable on?


On Wed, 25 Apr 2012, Sterling Augustine wrote:

> >> ?Then you don't actually need a definition, because the call will be
> >> optimised away
> >
> > You still need to support unoptimized builds.
> 
> GCC eliminates the unreachable block of an "if (0)" even without
> optimization. Many other compilers don't. It is an ongoing source of
> complications for getting compilers other than GCC to build the linux
> kernel which uses this approach extensively.

 That sounds silly, I didn't know that.  In this case a "static inline" 
dummy function would have to be provided indeed that makes the solution a 
bit less elegant then I would like it to be.  Still probably better than a 
maze of #ifdefs scattered throughout code, but YMMV.

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]