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

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
The relevant rule in ISO C is 6.7.6.3#15 (in C17): "For two function types 
to be compatible ... If one type has a parameter type list and the other 
type is specified by a function declarator that is not part of a function 
definition and that contains an empty identifier list, ... the type of 
each parameter shall be compatible with the type that results from the 
application of the default argument promotions".  Thus, a declaration with 
a float argument is incompatible with an unprototyped declaration.

*However* I see that when I implemented N2432 (removal of old-style 
function definitions) for C2x mode, I missed that that paper also removed 
that rule (keeping only the rule that an unprototyped declaration is 
incompatible with a variadic prototype).  It's not obvious to me that such 
a change was intentional and it doesn't appear to have been discussed (it 
wasn't the main point of that paper), and it's still the case that you 
can't actually call a function with (float) prototype if only an 
unprototyped declaration is in scope, without undefined behavior; I'll 
raise that question on the WG14 reflector.

Reply via email to