This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: warnings about empty function bodies.
- From: Ian Lance Taylor <iant at google dot com>
- To: "Ramana Radhakrishnan" <ramana dot r at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 29 Jun 2008 21:53:55 -0700
- Subject: Re: warnings about empty function bodies.
- References: <67ea2eb0806270853hb685d03r38f6cecc7fc10f45@mail.gmail.com>
"Ramana Radhakrishnan" <ramana.r@gmail.com> writes:
> Is there a warning flag to print out warning messages in case GCC
> compiles a function with an empty body ? I tried -Wextra and
> -Wempty-body but that didn't seem to work. The doco though for
> -Wempty-body suggests that this is only for empty if or for blocks.
I am not aware of any such warning. -Wempty-body exists mainly to
catch stray semicolons as in "if (x == 0);".
Ian