ANSI C -- miscellaneous suggestions

Martin Minow minow at decvax.UUCP
Wed Dec 17 10:15:50 AEST 1986


Sorry about the length of this, but my original comments apparently
require clarification.  I'm greatful to Doug Gwyn (@ brl-smoke.arpa)
for his comments.

1. I recommend that the total list of words be standardized (excepting
   those defined with an initial underscore.  This (hopefully) prevents
   proliferation of new quasi-reserved words. I.e. I want a guarantee
   that Ansi will never add a foo() function to <math.h>.

2. Horizontal tab has an independent existance in the pre-processor
   (page 74, lines 26-29).  It shouldn't (if I understand translation
   phases).

3. (Specifying internal representations linked to Latin 1) -- I understand
   that is infeasable to *require* ANSI (or Latin 1), but I would recommend
   defining Latin 1 as a reference, and stating that, for implementations
   supporting Latin 1, the internal representations of the specified
   characters *shall* be that given by Latin 1.  (You are also free to
   give representations for EBCDIC, if you can find a standard.)

4. Doug asks where VT and FF are declared "equivalent to newlines."
   That's my reading of section 2.2.2 (page 11) defining character
   display semantics.  If this is not the case, perhaps a clarification
   is in order.

5. I note that a sequence such as
	#define foo	0
	#if 0 && 10 / foo
	int this;
	#else
	int that;
   should not result in an error.  Doug seems to agree.  Unfortunately,
   this bugchecks at least one C compiler.  (And I had to work hard
   in Decus cpp to prevent it.)  The problem is that some preprocessors
   do not properly "short-circuit" evaluate && || and ?:.  Also, the
   standard should clarify just what happens if you do write
	#if 10 / 0
   I doubt that bugchecking is correct behavior.  I don't see anything
   in section 3.8.1 (pp. 75ff) discussing this.

Martin Minow
decvax!minow



More information about the Comp.lang.c mailing list