Henrik Nordstrom wrote: > On Tue, 30 Aug 2005, Antti-Juhani Kaijanaho wrote: > >> There is no declaration of printf in the file (either included or >> otherwise), and since printf is a stdarg function, a prototype must be >> in scope. > > Says who?
Says the C standard (ISO 9899:1999 ยง 6.5.2.2:6). The behaviour is undefined in such a case, and that's the standard's way of saying it's a mortal sin. > To my best knowledge that does not make it invalid C. Then your best knowledge is faulty, or at best obsolete. > Variable > arguments have existed since K&R where function prototypes didn't even > exists.. Yes, unportable, unstandardized ways of doing that. I hope nobody writes K&R1 C in this day and age. Even TCC aims for C99 compliance, so K&R1 C is doubly irrelevant. > Also the return type is optional, and defaults (per K&R) to int if not > specified. That does not contradict what I said. Implicit int, BTW, is forbidden by C99. > The missing () on main does however make it very invalid C. That's just a syntax violation. -- Antti-Juhani
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
