Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: dsr@mail.lns.cornell.edu (Daniel S. Riley)
Subject: Re: Annoying bug/warning in CXX on Digital
Date: 1999/07/30	[thread overview]
Message-ID: <sh7lnhx5mz.fsf@lnscu4.lns.cornell.edu> (raw)
In-Reply-To: 37A1D9A6.FD5138C5@cosmosbay.com

I sent a fuller response to Eric via email, but for anyone following
along at home:

Eric Dumazet <edumazet@cosmosbay.com> 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      <URL:http://www.lns.cornell.edu/~dsr/>
    "History teaches us that days like this are best spent in bed"



      reply	other threads:[~1999-07-30  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-29  4:00 Annoying bug/warning in CXX on Digital Eric Dumazet
1999-07-29  4:00 ` Daniel S. Riley
1999-07-30  4:00   ` Eric Dumazet
1999-07-30  4:00     ` Daniel S. Riley [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox