This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: promote a warning from -pedantic
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Dave Love <d dot love at dl dot ac dot uk>
- Cc: gcc-bugs at Gcc dot gnu dot org
- Date: 22 Jul 2002 08:29:00 -0700
- Subject: Re: promote a warning from -pedantic
- References: <rzqlm83vqsm.fsf@albion.dl.ac.uk>
Dave Love <d.love@dl.ac.uk> writes:
> You only get a warning about the following example from gcc 3.1 and
> earlier if you use -pedantic, whereas at least two proprietary
> compilers (fairly current Sun and SGI) actually give a fatal error. I
> think it should get a warning by default.
>
> void foo (float);
> void
> foo (bar)
> float bar;
> {
> return;
> }
>
> For what it's worth, this is derived from a real example (changes to
> Emacs).
It's a GNU C extension that this will work, so no warning is required,
see (*note (gcc)Function Prototypes::.). If you're concerned with
compatibility with other vendors' compilers, -ansi -pedantic is the
way to go.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>