Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-12 Thread Marek Polacek
On Tue, Aug 12, 2014 at 05:46:09PM +, Joseph S. Myers wrote: > On Sun, 10 Aug 2014, Marek Polacek wrote: > > > We weren't properly diagnosing neither the __func__ (introduced in C99), > > nor the __FUNCTION__/__PRETTY_FUNCTION__ (GNU extension) predefined > > identifiers. I believe we should;

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-12 Thread Joseph S. Myers
On Sun, 10 Aug 2014, Marek Polacek wrote: > We weren't properly diagnosing neither the __func__ (introduced in C99), > nor the __FUNCTION__/__PRETTY_FUNCTION__ (GNU extension) predefined > identifiers. I believe we should; the compiler ought to have a > compile-time switch for turning off extensi

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-12 Thread Dodji Seketeli
Marek Polacek a écrit: > Thise testcases use predefined identifiers, and without the > dg-options, they would compile with -ansi -pedantic-errors and fail. > Setting dg-options to "" makes the -ansi -pedantic-errors go away. > Setting it to e.g. -std=gnu99 would work as well. Oh, I see. Thanks.

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-11 Thread Marek Polacek
On Tue, Aug 12, 2014 at 08:17:15AM +0200, Dodji Seketeli wrote: > Marek Polacek a écrit: > > > > diff --git gcc/testsuite/gcc.dg/concat.c gcc/testsuite/gcc.dg/concat.c > > index 0b9d6f6..e3bfd46 100644 > > --- gcc/testsuite/gcc.dg/concat.c > > +++ gcc/testsuite/gcc.dg/concat.c > > @@ -1,6 +1,7 @

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-11 Thread Dodji Seketeli
Marek Polacek a écrit: > diff --git gcc/testsuite/gcc.dg/concat.c gcc/testsuite/gcc.dg/concat.c > index 0b9d6f6..e3bfd46 100644 > --- gcc/testsuite/gcc.dg/concat.c > +++ gcc/testsuite/gcc.dg/concat.c > @@ -1,6 +1,7 @@ > /* Copyright (C) 2001 Free Software Foundation, Inc. */ > > /* { dg-do

Re: [C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-10 Thread Marek Polacek
On Sun, Aug 10, 2014 at 05:16:27PM +0200, Marek Polacek wrote: > We weren't properly diagnosing neither the __func__ (introduced in C99), > nor the __FUNCTION__/__PRETTY_FUNCTION__ (GNU extension) predefined > identifiers. I believe we should; the compiler ought to have a > compile-time switch for

[C PATCH] Diagnose predefined identifiers in pedantic mode

2014-08-10 Thread Marek Polacek
We weren't properly diagnosing neither the __func__ (introduced in C99), nor the __FUNCTION__/__PRETTY_FUNCTION__ (GNU extension) predefined identifiers. I believe we should; the compiler ought to have a compile-time switch for turning off extensions. Bootstrapped/regtested on x86_64-linux, ok fo