[cfe-dev] PATCH: Cleanup function redeclaration representations
Doug Gregor
doug.gregor at gmail.com
Thu Apr 24 06:49:46 PDT 2008
On Thu, Apr 24, 2008 at 9:45 AM, Neil Booth <neil at daikokuya.co.uk> wrote:
> However, it's nice to complain about / reject the "x" in things like
>
> void foo1 (void) { extern int x(void); }
> void foo2 (void) { extern double x(void); }
>
> $ gcc /tmp/bug.c
> /tmp/bug.c: In function 'foo2':
> /tmp/bug.c:2: error: conflicting types for 'x'
> /tmp/bug.c:1: error: previous declaration of 'x' was here
>
> This is undefined behaviour according to the C standard; but there
> is little value in letting such stuff pass.
Very nice... it would definitely be helpful to diagnose this sort of problem.
- Doug
More information about the cfe-dev
mailing list