https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95445

Florian Weimer <fw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fw at gcc dot gnu.org

--- Comment #2 from Florian Weimer <fw at gcc dot gnu.org> ---
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&R projects, GCC already has -flto -Wlto-type-mismatch, which can diagnose
violations across translation units.

Reply via email to