From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e8ef51420f80a908 X-Google-Attributes: gidfee84,public From: dsr@mail.lns.cornell.edu (Daniel S. Riley) Subject: Re: Annoying bug/warning in CXX on Digital Date: 1999/07/30 Message-ID: #1/1 X-Deja-AN: 507095095 References: <37A02650.CA828161@cosmosbay.com> <37A1D9A6.FD5138C5@cosmosbay.com> Organization: LNS, Cornell U., Ithaca, NY 14853 Newsgroups: comp.unix.osf.osf1 I sent a fuller response to Eric via email, but for anyone following along at home: Eric Dumazet writes: > egcs -Wall -Wcast-qual for example says that my exemple is correct. > HPUX, SOLARIS, Unixware, AIX compilers are OK with this. egcs, Sun Workshop, and any other compiler that aspires to standards compliance will interpret typedef void *Opaque; const Opaque func(void); as void* const func(void); because that is what standard C semantics require. > Now I realise that this warning says 'your const attribute is ignored'. > So if I want the compiler checks that const invariance is preserved, I > bet that Digital CXX doesn't do the job. It's quite a pity. The difference is that cxx is (IMHO) doing a much better job--it at least tells you that const in that position doesn't do a darn thing. The other compilers interpret it the same way, they just don't tell you that it doesn't do anything. -- Dan Riley dsr@mail.lns.cornell.edu Wilson Lab, Cornell University "History teaches us that days like this are best spent in bed"