[llvm-bugs] [Bug 41851] -Wstrict-prototypes doesn't seem to warn on definitions

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 12 13:22:07 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41851

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
GCC is wrong. The definitions of g, h, and i are not unprototyped functions.

C11 6.7.6.3 paragraph 14:

"An empty list in a function declarator that is part of a definition of that
function specifies that the function has no parameters. The empty list in a
function declarator that is not part of a definition of that function specifies
that no information about the number or types of the parameters is supplied."

So:

void f(); // unprototyped
void g() {} // equivalent to 'void g(void) {}'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190512/b1c72922/attachment.html>


More information about the llvm-bugs mailing list