Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.co.jp (Norman Diamond) Newsgroups: comp.std.c Subject: alias accessing Message-ID: <10981@riks.csl.sony.co.jp> Date: 20 Oct 89 08:03:08 GMT Reply-To: diamond@ws.sony.junet (Norman Diamond) Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 24 Consider the following program fragment: int *a; const int *b; int z; b = a = (int *) malloc (sizeof (int)); z = *b; /* legal access to *a (aliased) according to section 3.3 */ z = *a; /* illegal access to *b (aliased) according to section 3.3 */ Do I really understand section 3.3 correctly? If b is actually declared in some other function which never wants to change the value of *b, I still cannot put a "const" on it, unless I'm sure that it will be aliased only to other consts. [I have read the offending section three times slowly before posting this foot.] -- Norman Diamond, Sony Corp. (diamond%ws.sony.junet@uunet.uu.net seems to work) Should the preceding opinions be caught or | James Bond asked his killed, the sender will disavow all knowledge | ATT rep for a source of their activities or whereabouts. | licence to "kill".