Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-07-05 Thread Jeff Law
On 07/04/2018 11:32 AM, Martin Sebor wrote: > On 07/03/2018 08:33 PM, Jeff Law wrote: >> >>> >>> But since the number of warnings here hasn't changed, the ones >>> in GCC logs predate my changes.  So updating the tests seems >>> like an improvement to consider independently of the patch. >>

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-07-04 Thread Martin Sebor
On 07/03/2018 08:33 PM, Jeff Law wrote: On 06/29/2018 09:54 AM, Martin Sebor wrote: All the warnings I have seen are because of declarations like the one in the test below that checks for the presence of symbol sin in the library: char sin (); int main () { return sin (); } GCC has

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-07-03 Thread Jeff Law
On 06/29/2018 09:54 AM, Martin Sebor wrote: > > All the warnings I have seen are because of declarations like > the one in the test below that checks for the presence of symbol > sin in the library: > >   char sin (); >   int main () { return sin (); } > > GCC has warned for this code by

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-30 Thread Bernd Edlinger
Hi Martin, really nice work. Just one minor nit: >--- a/gcc/doc/invoke.texi >+++ b/gcc/doc/invoke.texi >@@ -6568,8 +6568,13 @@ attributes. > @item -Wno-builtin-declaration-mismatch > @opindex Wno-builtin-declaration-mismatch > @opindex Wbuiltin-declaration-mismatch >-Warn if a built-in

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-29 Thread Eric Gallager
On 6/29/18, Jeff Law wrote: > On 06/27/2018 08:40 PM, Martin Sebor wrote: >> On 06/27/2018 03:53 PM, Jeff Law wrote: >>> On 06/27/2018 09:27 AM, Jakub Jelinek wrote: On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: >> About 115 tests fail due to incompatible declarations of

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-29 Thread Martin Sebor
On 06/29/2018 09:11 AM, Jeff Law wrote: On 06/27/2018 08:40 PM, Martin Sebor wrote: On 06/27/2018 03:53 PM, Jeff Law wrote: On 06/27/2018 09:27 AM, Jakub Jelinek wrote: On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: About 115 tests fail due to incompatible declarations of the

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-29 Thread Jakub Jelinek
On Fri, Jun 29, 2018 at 09:11:39AM -0600, Jeff Law wrote: > > I checked all GCC's config logs and although there are 543 > > instances of the -Wbuiltin-declaration-mismatch warning in > > an x86_64-linux build, none of them is an error and > > the number is the same as before the patch. > That's

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-29 Thread Jeff Law
On 06/27/2018 08:40 PM, Martin Sebor wrote: > On 06/27/2018 03:53 PM, Jeff Law wrote: >> On 06/27/2018 09:27 AM, Jakub Jelinek wrote: >>> On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: > About 115 tests fail due to incompatible declarations of > the built-in functions below (the

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Martin Sebor
On 06/27/2018 03:53 PM, Jeff Law wrote: On 06/27/2018 09:27 AM, Jakub Jelinek wrote: On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: About 115 tests fail due to incompatible declarations of the built-in functions below (the number shows the number of warnings for each functions):

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Martin Sebor
On 06/27/2018 12:44 PM, Eric Gallager wrote: On 6/26/18, Martin Sebor wrote: With the exception of built-ins with the ellipsis (like sprintf), GCC silently accepts declarations of built-in functions without prototypes as well as calls to such functions with any numbers or types of arguments,

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Martin Sebor
I was hoping to avoid the complexity but I appreciate the desire for a more permissive solution, at least for some transitional period. I've reworked the patch to avoid diagnosing 'void abort();' (the only library built-in that takes no arguments). Instead, calls that pass arguments to it are

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Jeff Law
On 06/27/2018 09:27 AM, Jakub Jelinek wrote: > On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: >>> About 115 tests fail due to incompatible declarations of >>> the built-in functions below (the number shows the number >>> of warnings for each functions): >>> >>> 428   abort >>>  58  

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Eric Gallager
On 6/26/18, Martin Sebor wrote: > With the exception of built-ins with the ellipsis (like sprintf), > GCC silently accepts declarations of built-in functions without > prototypes as well as calls to such functions with any numbers > or types of arguments, compatible or otherwise. Calls with >

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Jakub Jelinek
On Wed, Jun 27, 2018 at 09:17:07AM -0600, Jeff Law wrote: > > About 115 tests fail due to incompatible declarations of > > the built-in functions below (the number shows the number > > of warnings for each functions): > > > > 428   abort > >  58   exit > >  36   memcpy > >  17   memmove > >  15  

Re: [RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-27 Thread Jeff Law
On 06/26/2018 08:57 PM, Martin Sebor wrote: > With the exception of built-ins with the ellipsis (like sprintf), > GCC silently accepts declarations of built-in functions without > prototypes as well as calls to such functions with any numbers > or types of arguments, compatible or otherwise. 

[RFC PATCH] diagnose built-in declarations without prototype (PR 83656)

2018-06-26 Thread Martin Sebor
With the exception of built-ins with the ellipsis (like sprintf), GCC silently accepts declarations of built-in functions without prototypes as well as calls to such functions with any numbers or types of arguments, compatible or otherwise. Calls with arguments whose number and types match