pointer to incomplete type?

Karl Heuer karl at haddock.ima.isc.com
Wed Jun 6 07:45:06 AEST 1990


In article <1680 at mcrware.UUCP> jejones at mcrware.UUCP (James Jones) writes:
>On computers for which pointers to different types don't have the same format
>(the canonical examples, I think, are non-byte-addressable processors),
>how can one safely declare a pointer to an incomplete structure...?

I believe it is still true (i.e. one can infer from the Standard) that "all
struct pointers smell the same", precisely because it must be legal to use an
incomplete type in the contexts you're thinking of.  This means that, on such
an architecture, either all structs will be word-aligned (even if they contain
only chars) or else (less likely) all struct pointers will use byte-pointer
format (even if the struct is word-aligned).

(Of course, the as-if rule allows the implementation to play tricks here if
the user can't possibly tell the difference.)

Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.std.c mailing list