RFC/RFHelp: c-decl.c rewrite - almost but not quite

Dale Johannesen dalej@apple.com
Wed Mar 17 00:20:00 GMT 2004


On Mar 16, 2004, at 4:02 PM, Joseph S. Myers wrote:
> Specifying that it has no parameters is not the same as giving it a
> prototype type; it is simply contrasting with other empty lists that 
> give
> no information at all.  Any definition with an identifier list 
> specifies
> the parameters without giving a prototype type.  (6.9.1#7 says that a
> definition *with a parameter type list* serves as a prototype for the 
> rest
> of that translation unit.)  We've been through this before in PR 6326.
> Only parameter type lists give functions a type with a prototype.

Indeed, gcc doesn't even warn about this:

int f() {return 0;}
int h() {return f(5);}

That's going a bit far, don't you think?  It's undefined behavior.



More information about the Gcc-patches mailing list