sizeof a struc field

Christoph Kuenkel ckl at uwbln.UUCP
Tue Oct 17 06:19:44 AEST 1989


In article <11280 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:

> That's not what I've been saying.  Garbage constructs have no type.
> ((thing*)0)->member is a garbage construct.  It has no type.
> 
> In case you don't know what I mean by "garbage construct", it is
> a sequence of C source characters for which the Standard assigns
> no valid meaning.
like ``<>??|.'' ?

hm, perhaps you can cite a paragraph in the standard that says,
subtracting 5 from a long int has no meaning assigned.  should i scan
the pANS for something like that?

this discussion gets somewhat boring as long as the one side argues
that ``the standard says so''.  it should better be explained why it
says so and what it says,  how to solve the problem in question (yes,
there was a real problem!).

for me, ((thing *)0) sounds quite reasonable.  i agree that there is no
meaningfull evaluation.  i never saw a compiler that claimed this
construct to be ``syntactically wrong''.  i think that it should be
possible to ``assign'' meaning to that construct in an unambigous way.

so *why* does the standard define it to be garbage?
-- 
# include <std/disclaimer.h>
Christoph Kuenkel/UniWare GmbH       Kantstr. 152, 1000 Berlin 12, West Germany
ck at tub.BITNET                ckl at uwbln             {unido,tmpmbx,tub}!uwbln!ckl



More information about the Comp.lang.c mailing list