$1 check for first person who convinces me main can't be reserved
Arthur David Olson
ado at elsie.UUCP
Sun Feb 28 02:56:42 AEST 1988
> > IMP: Main. One of our extensions makes it a keyword.
> > You're not allowed to use it at all.
> This is silly. The proposed standard makes clear what the function of
> main() is. . .
Oh well, so much for my efforts to keep my example program short.
Let's try this slightly longer one:
int xyzzy; main() { return 0; }
Now last time I looked, xyzzy wasn't mentioned anywhere in the Standard,
so the point made above about "main" doesn't apply. So let's head back
to Pine Ridge and see what Lum ("IMP") and Abner ("ME") are up to. Listen:
ME: By doggies, my program
int xyzzy; main() { return 0; }
doesn't return zero.
IMP: By grannies, you're right. . .you misused a keyword.
ME: Huh?
IMP: Xyzzy. One of our extensions makes it a keyword.
You're not allowed to use it at all.
ME: What? You can't make that extension! It alters the
behavior of my strictly conforming program!
IMP: Your program isn't strictly conforming. You use a
(extended) keyword, which Section 3.1.1 says you shall
not do. The "shall not" is not in a "Constraint" section.
Section 1.6 says "If a 'shall' or 'shall not' requirement
that appears outside of a constraint is violated, the
behavior is undefined.' And since your program produced
"output dependent on. . .undefined. . .behavior," it isn't
strictly conforming, per Section 1.7.
--
ado at vax2.nlm.nih.gov ADO, VAX, and NIH are Ampex and DEC trademarks
More information about the Comp.lang.c
mailing list