LWN.net Logo

Dennis Ritchie RIP your legacy...

Dennis Ritchie RIP your legacy...

Posted Oct 14, 2011 21:45 UTC (Fri) by jengelh (subscriber, #33263)
In reply to: Dennis Ritchie RIP your legacy... by HelloWorld
Parent article: Dennis Ritchie RIP

IIRC, the standard demanded that main be one of two signatures: int main(void) or int main(int, char **) only. That would be in line with page 24's "you should use int main(void) - because the standard says so", provided the PDF is right.


(Log in to post comments)

Dennis Ritchie RIP your legacy...

Posted Oct 17, 2011 11:50 UTC (Mon) by jwakely (subscriber, #60262) [Link]

An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters.
i.e. In a function definition (as opposed to a prototype) int main() is the same as int main(void) and so is correct.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds