Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cwjcc!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: const in latest draft Message-ID: <10339@smoke.BRL.MIL> Date: 30 May 89 07:11:13 GMT References: <16259@gryphon.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 31 In article <16259@gryphon.COM> sarima@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.