This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: if() and trailing ;
- From: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- To: simon at nostalgeek dot com
- Cc: dalej at apple dot com, gcc at gcc dot gnu dot org
- Date: Mon, 31 Jul 2006 22:40:57 -0400 (EDT)
- Subject: Re: if() and trailing ;
- References: <5A1EA79B-D8B0-4076-8E22-7F81BAA5685C@nostalgeek.com> <E9B4FBE8-7CFB-4361-9420-45D1AB6D7A6B@apple.com> <86655FC2-F852-4188-9F09-77258CD2F973@nostalgeek.com>
> > -Wextra enables this warning, as documented. Not 100% sure it
> > was there in 3.3. If not you might want a more recent compiler.
>
> Doesn't work with 3.3, unrecognized option `-Wextra'
> But with 4.0.1 it does:
>
> test.c:2: warning: empty body in an if-statement
>
> Thanks!
> Simon
Older versions of gcc called this option simply `-W'. Try that
instead if you can't use a 4.x gcc. I'm able to produce a warning
about this problem with 3.4.6, for example.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu