Null revisited (briefly)

Guy Harris guy at auspex.UUCP
Fri Mar 3 18:22:50 AEST 1989


>Isn't it possible to postulate the existence of a bizarre 1's
>complement machine in which the lexical analyzer produces
>binary 00000000000000000000000000000000 when it sees the
>character 0, but 11111111111111111111111111111111 when it
>sees the sequence '\0'?

Yes, one could postulate that, but given that:

	1) '\0' is ASCII NUL on ASCII implementations of C (K&R I, p.
	   181);

	2) "it is guaranteed that a member of the standard character set
	   is non-negative" (K&R I, p. 183);

	3) the bit pattern you list is negative zero on a 1's complement
	   machine;

if the lexical analyzer is a lexical analyzer for a C implementation
that uses ASCII as "the standard character set", or that uses any other
character set in which '\0' is "a member of the standard character set",
the technical term for that C implementation would be "buggy".



More information about the Comp.lang.c mailing list