Quote without comment on char constant expansion

Tainter tainter at ihlpg.ATT.COM
Fri Apr 15 07:55:35 AEST 1988


In article <11056 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> The argument against this, of course, is that somehow `stringize'
> is useful while `charize' is not, or not enough so.

Is

    "ABCD"[0]
								    TM
legal ANSI C?  If not, why not?  It certainly works in AT&T R&D UNIX   C.

If so then

    (#x[0])

becomes a 'charize' expression equivalent to a direct charize operator for
all intents and purposes.  I can't seriously imagine a compiler not optimizing
this expression to the character constant.

> In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)


--j.a.tainter



More information about the Comp.lang.c mailing list