"the integer constant zero"

Chris Torek chris at mimsy.UUCP
Sat Apr 9 02:30:57 AEST 1988


>In article <10754 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>>[...] the integer constant `0' in a pointer context [...].  What is
>>`the integer constant 0'?

In article <1032 at mcgill-vision.UUCP> mouse at mcgill-vision.UUCP
(der Mouse) writes:
>"the integer constant zero" is not necessarily the same as "an integer
>constant expression zero".

My copy (or rather, Fred's copy, which I borrowed) of the draft
standard is Elsewhere at the moment, but what was `clear' to me
(constant 0 => expression that evaluates as a constant and to 0) was
apparently `clear' to X3J11 as well, because that was what the draft
said.

Now, however, there seems to be some sentiment to rephrase it.
Among other problems,

	int *p;
	p = 1 ? (void *)0 : (void *)0;

is not quite legal, even though

	p = 1 ? 0 : 0;

is!

This sort of nasty fiddly detail is what makes getting standards
right so hard.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list