increment casted void pointer -- ANSI?

Neal Weidenhofer nw at uts.amdahl.com
Tue Apr 2 11:54:16 AEST 1991


In article <15619 at smoke.brl.mil>, gwyn at smoke.brl.mil (Doug Gwyn) writes:
> Sure it "overlaps", or acts as if it did.  A conforming implementation
> that, e.g. stores floating-point data in a different address space from
> integer data may have to jump through hoops if it wishes to make the
> aliasing of the representations actually work.  However, such a program
> would have to be successfully translated, it just may not work right (in
> which case the fake pointer business would probably malfunction too).

I can't find any such requirement in X3.159-1989.  It says in
Sec.3.3.2.3. "...if a member of a union object is accessed after a
value has been stored in a different member of the object, the
behavior is implementation-defined."  I know we all discussed support
for type punning using unions, but it doesn't seem to be required.
The footnote clearly indicates that we intended it to work but
footnotes are, alas, not a part of the standard.

So, as far as I can see, no hoop jumping is required if the
implementation writers/distributors document the fact.  It seems to be
another quality-of-implementation issue.

The opinions expressed above are mine (but I'm willing to share.)

			Regards,
And while the future's          Neal Weidenhofer
	there for anyone        nw at amdahl.uts.amdahl.com
To change, still you            Amdahl Corporation
	know it seems           P. O. Box 3470
It would be easier sometimes    1250 E. Arques Ave. (M/S 316)
	to change the past.     Sunnyvale, CA 94088-3470
				(408)737-5007



More information about the Comp.lang.c mailing list