<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:aaronpuchert@alice-dsl.net" title="Aaron Puchert <aaronpuchert@alice-dsl.net>"> <span class="fn">Aaron Puchert</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - -Wstrict-prototypes doesn't seem to warn on definitions"
href="https://bugs.llvm.org/show_bug.cgi?id=41851">bug 41851</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Fixed By Commit(s)</td>
<td>
</td>
<td>2f26bc5542705c390bf17af2fdfc31e056147ea9
</td>
</tr>
<tr>
<td style="text-align:right;">Assignee</td>
<td>unassignedclangbugs@nondot.org
</td>
<td>aaronpuchert@alice-dsl.net
</td>
</tr>
<tr>
<td style="text-align:right;">Hardware</td>
<td>PC
</td>
<td>All
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>FIXED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>aaronpuchert@alice-dsl.net
</td>
</tr>
<tr>
<td style="text-align:right;">OS</td>
<td>Windows NT
</td>
<td>All
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - -Wstrict-prototypes doesn't seem to warn on definitions"
href="https://bugs.llvm.org/show_bug.cgi?id=41851#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - -Wstrict-prototypes doesn't seem to warn on definitions"
href="https://bugs.llvm.org/show_bug.cgi?id=41851">bug 41851</a>
from <span class="vcard"><a class="email" href="mailto:aaronpuchert@alice-dsl.net" title="Aaron Puchert <aaronpuchert@alice-dsl.net>"> <span class="fn">Aaron Puchert</span></a>
</span></b>
<pre>(In reply to Richard Smith from <a href="show_bug.cgi?id=41851#c1">comment #1</a>)
<span class="quote">> GCC is wrong. The definitions of g, h, and i are not unprototyped functions.
> [...]
> void f(); // unprototyped
> void g() {} // equivalent to 'void g(void) {}'</span >
We discussed this in IRC afterwards, and it turns out the standard is not
terribly explicit, but GCC is probably right that g is not a prototype, and
that "void g() {}" is not equivalent to "void g(void) {}". In 6.9.1p7:
"If the declarator includes a parameter type list, the list also specifies the
types of all the parameters; such a declarator also serves as a function
prototype for later calls to the same function in the same translation unit."
This refers to 6.7.6.3p5: "If, in the declaration “T D1”, D1 has
the form
D(parameter-type-list)
or
D(identifier-list_opt)
[...]". Later in 6.11.7 it also refers only to the parameter-type-list
variant as prototype: "The use of function definitions with separate
parameter identifier and declaration lists (not prototype-format
parameter type and identifier declarators) is an obsolescent feature."
And if you look at the grammar you'll find that an empty list cannot be a
parameter-type-list:
parameter-type-list:
parameter-list
parameter-list , ...
parameter-list:
parameter-declaration
parameter-list , parameter-declaration
parameter-declaration:
declaration-specifiers declarator
declaration-specifiers abstract-declarator_opt
So I fixed this in <a href="https://reviews.llvm.org/D66919">https://reviews.llvm.org/D66919</a>, which is going to be in
Clang 11.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>