Re: Switch -Wunused-variable on?

Sterling Augustine
2012-04-25T18:20:31Z

On Wed, Apr 25, 2012 at 11:13 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "Maciej W. Rozycki" <macro@codesourcery.com> writes:
>
>>  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.

If the project cares about being able to build with compilers other
than GCC, then it should consider this approach as carefully as it
considers using any other GCC extension.

Sterling