[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2023-10-14 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

Eric Gallager  changed:

   What|Removed |Added

 CC||fw at gcc dot gnu.org

--- Comment #6 from Eric Gallager  ---
Possibly relevant to Florian Weimer's work on stricter warnings

[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2019-07-05 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

--- Comment #5 from Eric Gallager  ---
(In reply to Martin Sebor from comment #4)
> Confirmed.  My preference would be to resolve pr82922 and diagnose all calls
> to functions without a prototype.

Agreed.

> Short of that, this could be handled by saving the type of the first call to a
> function without a prototype in a translation unit, comparing it to the type 
> of
> each subsequent call, and warning if they don't match.

What about with LTO?

[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2018-10-06 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-10-06
 Ever confirmed|0   |1

--- Comment #4 from Martin Sebor  ---
Confirmed.  My preference would be to resolve pr82922 and diagnose all calls to
functions without a prototype.  Short of that, this could be handled by saving
the type of the first call to a function without a prototype in a translation
unit, comparing it to the type of each subsequent call, and warning if they
don't match.

[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2018-10-06 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

Eric Gallager  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
(In reply to Eric Gallager from comment #2)
> Related to bug 82922 and bug 83656

Adding Martin Sebor on cc to this one, too

[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2018-10-06 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

Eric Gallager  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=82922,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83656

--- Comment #2 from Eric Gallager  ---
Related to bug 82922 and bug 83656

[Bug c/86418] warn about mismatch in type between argument and parameter type for declaration without prototype

2018-07-06 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86418

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=48063

--- Comment #1 from Eric Gallager  ---
I got more warnings than that:

$ gcc -O2 -c 86418.c -Wall -Wextra -Wold-style-definition
-Wold-style-declaration -Wtraditional-conversion -Wdouble-promotion
-Wstrict-prototypes -Wfloat-equal -Wunsuffixed-float-constants
-Wmissing-prototypes -Wmissing-declarations
86418.c:2:1: warning: function declaration isn't a prototype
[-Wstrict-prototypes]
 static void bar ();
 ^~
86418.c:12:1: warning: 'bar' was used with no prototype before its definition
[-Wmissing-prototypes]
 bar (double i)
 ^~~
86418.c: In function 'bar':
86418.c:14:7: warning: comparing floating point with == or != is unsafe
[-Wfloat-equal]
   if (i)
   ^
86418.c: In function 'bar.constprop':
86418.c:14:6: warning: 'i' is used uninitialized in this function
[-Wuninitialized]
   if (i)
  ^
$

But I'm guessing you want one for the bar(1); call on line 7 too?