Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-18 Thread Bernd Edlinger
On 11/18/16 23:15, Bernd Edlinger wrote: >>> - TREE_NOTHROW (olddecl) = 0; >>> + TREE_NOTHROW (olddecl) = TREE_NOTHROW (newdecl); >> >> I still think a better fix would be to add a copy of TREE_NOTHROW to the >> else block of the if (types_match), to go with the existing copies of >>

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-18 Thread Bernd Edlinger
On 11/18/16 22:19, Jason Merrill wrote: > On 11/05/2016 12:44 PM, Bernd Edlinger wrote: >> + warning_at (DECL_SOURCE_LOCATION (newdecl), 0, >> + "declaration of %q+#D conflicts with built-in " >> + "declaration %q#D", newdecl, olddecl); > > There needs to be a

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-18 Thread Jason Merrill
On 11/05/2016 12:44 PM, Bernd Edlinger wrote: + warning_at (DECL_SOURCE_LOCATION (newdecl), 0, + "declaration of %q+#D conflicts with built-in " + "declaration %q#D", newdecl, olddecl); There needs to be a way to disable this warning,

[PING] [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-11 Thread Bernd Edlinger
Ping... the latest version of the patch was here: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00505.html Thanks Bernd. On 11/02/16 22:15, Bernd Edlinger wrote: > On 11/02/16 18:51, Jason Merrill wrote: >> On 11/02/2016 02:11 AM, Bernd Edlinger wrote: >>> On 11/01/16 19:15, Bernd Edlinger

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-05 Thread Bernd Edlinger
On 11/03/16 20:58, Jason Merrill wrote: > On Wed, Nov 2, 2016 at 5:15 PM, Bernd Edlinger > wrote: >> Yes, I am inclined to enable the warning by default now. >> >> Most of the test cases are fixable in a fairly obvious way, >> see attachment. >> Most test cases are

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-03 Thread Jason Merrill
On Wed, Nov 2, 2016 at 5:15 PM, Bernd Edlinger wrote: > On 11/02/16 18:51, Jason Merrill wrote: >> On 11/02/2016 02:11 AM, Bernd Edlinger wrote: >>> On 11/01/16 19:15, Bernd Edlinger wrote: On 11/01/16 18:11, Jason Merrill wrote: > On Tue, Nov 1, 2016 at 11:45

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-02 Thread Bernd Edlinger
On 11/02/16 18:51, Jason Merrill wrote: > On 11/02/2016 02:11 AM, Bernd Edlinger wrote: >> On 11/01/16 19:15, Bernd Edlinger wrote: >>> On 11/01/16 18:11, Jason Merrill wrote: On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger wrote: > On 11/01/16 16:20,

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-02 Thread Jason Merrill
On 11/02/2016 02:11 AM, Bernd Edlinger wrote: On 11/01/16 19:15, Bernd Edlinger wrote: On 11/01/16 18:11, Jason Merrill wrote: On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger wrote: On 11/01/16 16:20, Jason Merrill wrote: On 10/17/2016 03:18 PM, Bernd Edlinger

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-02 Thread Bernd Edlinger
On 11/01/16 22:31, Jason Merrill wrote: > On Tue, Nov 1, 2016 at 4:00 PM, Bernd Edlinger > wrote: >> On 11/01/16 20:48, Jason Merrill wrote: else if ((DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl))

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-02 Thread Bernd Edlinger
On 11/02/16 07:11, Bernd Edlinger wrote: > On 11/01/16 19:15, Bernd Edlinger wrote: >> On 11/01/16 18:11, Jason Merrill wrote: >>> On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger >>> wrote: On 11/01/16 16:20, Jason Merrill wrote: > On 10/17/2016 03:18 PM, Bernd

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-02 Thread Bernd Edlinger
On 11/01/16 19:15, Bernd Edlinger wrote: > On 11/01/16 18:11, Jason Merrill wrote: >> On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger >> wrote: >>> On 11/01/16 16:20, Jason Merrill wrote: On 10/17/2016 03:18 PM, Bernd Edlinger wrote: I'm not even sure we need

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Jason Merrill
On Tue, Nov 1, 2016 at 4:00 PM, Bernd Edlinger wrote: > On 11/01/16 20:48, Jason Merrill wrote: >>> else if ((DECL_EXTERN_C_P (newdecl) >>> && DECL_EXTERN_C_P (olddecl)) >>>|| compparms (TYPE_ARG_TYPES

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Bernd Edlinger
On 11/01/16 20:48, Jason Merrill wrote: >> else if ((DECL_EXTERN_C_P (newdecl) >> && DECL_EXTERN_C_P (olddecl)) >>|| compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)), >> TYPE_ARG_TYPES (TREE_TYPE

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Jason Merrill
On Tue, Nov 1, 2016 at 2:15 PM, Bernd Edlinger wrote: > On 11/01/16 18:11, Jason Merrill wrote: >> On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger >> wrote: >>> On 11/01/16 16:20, Jason Merrill wrote: On 10/17/2016 03:18 PM, Bernd

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Bernd Edlinger
On 11/01/16 18:11, Jason Merrill wrote: > On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger > wrote: >> On 11/01/16 16:20, Jason Merrill wrote: >>> On 10/17/2016 03:18 PM, Bernd Edlinger wrote: >>> I'm not even sure we need a new warning. Can we combine this warning >>>

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Jason Merrill
On Tue, Nov 1, 2016 at 11:45 AM, Bernd Edlinger wrote: > On 11/01/16 16:20, Jason Merrill wrote: >> On 10/17/2016 03:18 PM, Bernd Edlinger wrote: >> I'm not even sure we need a new warning. Can we combine this warning >> with the block that currently follows? > > After

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Bernd Edlinger
On 11/01/16 16:20, Jason Merrill wrote: > On 10/17/2016 03:18 PM, Bernd Edlinger wrote: >> +@item -Wbuiltin-function-redefined @r{(C++ and Objective-C++ only)} >> +@opindex Wbuiltin-function-redefined >> +@opindex Wno-builtin-function-redefined >> +Do warn if built-in functions are redefined.

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Bernd Edlinger
On 11/01/16 16:02, Jason Merrill wrote: > On 10/17/2016 03:18 PM, Bernd Edlinger wrote: >> Regarding this hunk: >> >> /* Whether or not the builtin can throw exceptions has no >> bearing on this declarator. */ >> - TREE_NOTHROW (olddecl) = 0; >> + TREE_NOTHROW

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Jason Merrill
On 10/17/2016 03:18 PM, Bernd Edlinger wrote: +@item -Wbuiltin-function-redefined @r{(C++ and Objective-C++ only)} +@opindex Wbuiltin-function-redefined +@opindex Wno-builtin-function-redefined +Do warn if built-in functions are redefined. This option is only +supported for C++ and

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Jason Merrill
On 10/17/2016 03:18 PM, Bernd Edlinger wrote: Regarding this hunk: /* Whether or not the builtin can throw exceptions has no bearing on this declarator. */ - TREE_NOTHROW (olddecl) = 0; + TREE_NOTHROW (olddecl) = TREE_NOTHROW (newdecl); You may ask, why the old

[PING**2] [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-11-01 Thread Bernd Edlinger
Ping... On 10/24/16 15:36, Bernd Edlinger wrote: > Hi! > > I'd like to ping for my patch here: > https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01348.html > > > Thanks > Bernd. > > On 10/17/16 21:18, Bernd Edlinger wrote: >> On 10/17/16 20:05, Joseph Myers wrote: >>> On Sun, 16 Oct 2016, Bernd

[PING] [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-24 Thread Bernd Edlinger
Hi! I'd like to ping for my patch here: https://gcc.gnu.org/ml/gcc-patches/2016-10/msg01348.html Thanks Bernd. On 10/17/16 21:18, Bernd Edlinger wrote: > On 10/17/16 20:05, Joseph Myers wrote: >> On Sun, 16 Oct 2016, Bernd Edlinger wrote: >> >>> Second, the declaration in the glibc header

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-17 Thread Bernd Edlinger
On 10/17/16 20:05, Joseph Myers wrote: > On Sun, 16 Oct 2016, Bernd Edlinger wrote: > >> Second, the declaration in the glibc header files simply look wrong, >> because the type of argv, and envp is "char *const *" while the >> builtin function wants "const char**", thus only the array of char* >>

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-17 Thread Joseph Myers
On Sun, 16 Oct 2016, Bernd Edlinger wrote: > Second, the declaration in the glibc header files simply look wrong, > because the type of argv, and envp is "char *const *" while the > builtin function wants "const char**", thus only the array of char* > itself is const, not the actual char stings

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-16 Thread Bernd Edlinger
On 10/06/16 16:11, Bernd Edlinger wrote: > Hi! > > Currently C++ does not warn at all when built-in functions are > re-defined with a different signature, while C does warn on that > even without -Wall. > > Thus I'd like to propose a -Wall enabled warning for that in C++ only. > > Initially I

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-10 Thread Bernd Edlinger
On 10/06/16 22:37, Bernd Edlinger wrote: > On 10/06/16 16:14, Kyrill Tkachov wrote: >> >> @@ -1553,7 +1588,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool >> >> /* Whether or not the builtin can throw exceptions has no >>bearing on this declarator. */ >> - TREE_NOTHROW

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-06 Thread Bernd Edlinger
On 10/06/16 16:14, Kyrill Tkachov wrote: > > @@ -1553,7 +1588,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool > > /* Whether or not the builtin can throw exceptions has no >bearing on this declarator. */ > - TREE_NOTHROW (olddecl) = 0; > + TREE_NOTHROW (olddecl) =

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-06 Thread Kyrill Tkachov
Hi Bernd, Not familiar with this area but one comment below... On 06/10/16 15:12, Bernd Edlinger wrote: Hi! Currently C++ does not warn at all when built-in functions are re-defined with a different signature, while C does warn on that even without -Wall. Thus I'd like to propose a -Wall

[PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-10-06 Thread Bernd Edlinger
Hi! Currently C++ does not warn at all when built-in functions are re-defined with a different signature, while C does warn on that even without -Wall. Thus I'd like to propose a -Wall enabled warning for that in C++ only. Initially I tried to warn unconditionally but that made too many tests

Re: [PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-08-22 Thread Joseph Myers
On Sat, 20 Aug 2016, Bernd Edlinger wrote: > Initially I tried to warn unconditionally but that made too many tests > in the C++ testsuite emit that warning :-( I think that's probably a peculiarity of testsuite code trying to avoid standard headers, and does not reflect what normal user C++

[PATCH, C++] Warn on redefinition of builtin functions (PR c++/71973)

2016-08-20 Thread Bernd Edlinger
Hi! Currently C++ does not warn at all when built-in functions are re-defined with a different signature, while C does warn on that even without -Wall. Thus I'd like to propose a -Wall enabled warning for that in C++. Initially I tried to warn unconditionally but that made too many tests in