Should #include <foo.h>; compile?

Doug Gwyn gwyn at smoke.brl.mil
Wed Feb 20 10:33:34 AEST 1991


In article <7605 at jhunix.HCF.JHU.EDU> barrett at jhunix.HCF.JHU.EDU (Dan Barrett) writes:
>Should this program compile?
>	#include <stdio.h>;
>	main() {}

Since it violates at least one syntax rule in the C standard, a
diagnostic is required from a conforming implementation.

The failure of main() to return a value results in undefined behavior,
by the way.



More information about the Comp.lang.c mailing list