mod.std.c Digest V5#6

Orlando Sotomayor-Diaz osd7 at homxa.UUCP
Wed Apr 17 08:56:17 AEST 1985


From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c>


mod.std.c Digest            Tue, 16 Apr 85       Volume 5 : Issue   6 

Today's Topics:
                      #endif comments & % as mod
----------------------------------------------------------------------

Date: Fri, 12 Apr 85 1:03:59 EST
From: Doug Gwyn (VLD/VMB) <ucbvax!gwyn at Brl-Vld.ARPA>
Subject: #endif comments & % as mod
To: cbosgd!std-c at BERKELEY

My reading of the 11-Feb-1985 draft standard is that whitespace may
occur after the #else, #elif, or #endif keyword before the newline.
And a /* comment */ is syntactically equivalent to white space.  So
	#endif	/* DEBUG */
would be valid, but not
	#endif	JUNK
I don't believe the latter was ever officially sanctioned.  Perhaps
someone else may have a different reading..

As to "not breaking existing code", that should be amended to "not
invalidating previously legal code".  Lots of existing code appears
to work under limited circumstances but is already really broken.
No standard could possibly reconcile ALL the conflicting C systems
in use without breaking some apparently-working code.  In such a
case it seems reasonable to extend the existing "official" language
rules in a way that best meets the needs for which people were
having to cheat.

I think the reason % is not necessarily a true mod function is that
it was intended to be implemented as directly as possible by the
target machine's DIV instruction.  This is in line with C's r^ole
as a system implementation language.  I agree, however, that this
decision gets in the way of using % in a provably correct way.

------------------------------

End of mod.std.c Digest - Tue, 16 Apr 85 17:54:39 EST
******************************
USENET -> posting only through cbosgd!std-c.
ARPA -> ... through cbosgd!std-c at BERKELEY.ARPA (NOT to INFO-C)
In all cases, you may also reply to the author(s) above.



More information about the Mod.std.c mailing list