[Bug c/95445] diagnose incompatible calls to functions declared without prototype

2023-05-12 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95445

Sam James  changed:

   What|Removed |Added

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

--- Comment #3 from Sam James  ---
I don't think we need to go beyond that (I don't really care about the uses).

That'll make this a dupe of/depends on PR108694?

[Bug c/95445] diagnose incompatible calls to functions declared without prototype

2023-05-12 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95445

Florian Weimer  changed:

   What|Removed |Added

 CC||fw at gcc dot gnu.org

--- Comment #2 from Florian Weimer  ---
Current Clang warns like this:

t.c:17:5: warning: passing arguments to 'g' without a prototype is deprecated
in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
  g (1); // (presumably) okay, f's type is 'void (int)'
^
t.c:18:5: warning: passing arguments to 'g' without a prototype is deprecated
in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
  g ("foo"); // should be diagnosed
^
t.c:19:5: warning: passing arguments to 'g' without a prototype is deprecated
in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
  g (1, "bar");  // ditto
^

Maybe that's sufficient?

Trying to infer the type of g from its uses seems to be rather questionable.
For K projects, GCC already has -flto -Wlto-type-mismatch, which can diagnose
violations across translation units.

[Bug c/95445] diagnose incompatible calls to functions declared without prototype

2021-10-26 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95445

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #1 from Eric Gallager  ---
Is this like clang's -Wknr-promoted-parameter?
https://clang.llvm.org/docs/DiagnosticsReference.html#wknr-promoted-parameter

[Bug c/95445] diagnose incompatible calls to functions declared without prototype

2020-05-30 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95445

Martin Sebor  changed:

   What|Removed |Added

 Blocks||87403
   Severity|normal  |enhancement
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=92212
   Keywords||diagnostic


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87403
[Bug 87403] [Meta-bug] Issues that suggest a new warning