This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/83397] New: void f() { } has zero arguments
- From: "izaberina at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Dec 2017 16:20:10 +0000
- Subject: [Bug c/83397] New: void f() { } has zero arguments
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83397
Bug ID: 83397
Summary: void f() { } has zero arguments
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: izaberina at gmail dot com
Target Milestone: ---
https://godbolt.org/g/8ZcWKk
according to c11 6.7.6.3, function prototypes without arguments don't specify
anything about their parameters
gcc is assuming that f1 takes an unspecified number of arguments, and as such
it's treating it as potentially vararg, and that's (probably) why it clears eax
before calling it
in my understanding, this requirement only applies to prototypes and not to
function definitions
furthermore, the function is static and gcc is definitely able to see what it
does so it's not needed either way