const in latest draft

Doug Gwyn gwyn at smoke.BRL.MIL
Tue May 30 17:11:13 AEST 1989


In article <16259 at gryphon.COM> sarima at gryphon.COM (Stan Friesen) writes:
>[is] the clause in 3.5.3 stating that "For two qualified types to be
>compatible, both shall have the identically qualified version of a
>compatible type" ... still present?

Yes.

>is the footnote on the previous page stating "The implementation may place
>a const object that is not volatile in read-only storage" still present?

Yes.

>[is it] still true that "All declarations that refer to the same object or
>function shall have compatible type; otherwise the behavior is undefined"
>(as per 3.1.2.6) [?]

Yes.

>I am asking because I question the necessity of an implementation decision
>made by Lattice Corp in version 3.4 of their C compiler, and I need to know
>if my reasoning based on the Jan 11 draft is still valid.

I don't know what Lattice has been up to; if you would tell us then perhaps
we could directly address the specific issue.

Note that the final draft clarifies that qualified and unqualified versions
of a type have the same representation and alignment requirements, as do
pointers to qualified and unqualified versions of compatible types.  This
implies interchangeability as arguments to functions, return values from
functions, and members of unions, thus legitimatizing a decision K&R made
when preparing examples for the second edition of their book.



More information about the Comp.std.c mailing list