delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/09/24/02:36:08

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
Date: Wed, 24 Sep 2014 02:35:52 -0400
Message-Id: <201409240635.s8O6ZqOw019084@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: geda-user AT delorie DOT com
CC: geda-user AT delorie DOT com
In-reply-to: <20140924062143.GA21949@visitor2.iram.es> (message from Gabriel
Paubert on Wed, 24 Sep 2014 08:21:44 +0200)
Subject: Re: [geda-user] Banging my head against the guile-for-windows wall
References: <20140923045453 DOT 56dc3de2 AT akka>
<CAOuGh8_bfL2KJDLt-qkU7v0wS3UBkbHeej6ScVLJJfHnOR_6oQ AT mail DOT gmail DOT com>
<lvssr7$lun$1 AT ger DOT gmane DOT org>
<5421FF2E DOT 4010709 AT sbcglobal DOT net>
<lvtcdd$53a$1 AT ger DOT gmane DOT org>
<20140924040432 DOT 22429 DOT qmail AT stuge DOT se> <20140924062143 DOT GA21949 AT visitor2 DOT iram DOT es>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > This is ugly but if void * and int are the same size it is harmless.

I've seen way too many platforms where pointers and "int" are
different sizes, to give this one a pass...

Worse, on the msp430, large-model pointers are neither int-sized nor
long-sized.  Not that gEDA will ever run on an msp430 ;-)

> I consider this one a spurious warning, it may probably be silenced by inserting
> an useless and ugly cast, but I really wonder on which drugs the compiler
> writers were when they decided to add it. You should always be able to pass
> a non-const argument to a const parameter.

You're confusing a const argument with an argument which is a *pointer
to* a const value.  It's the latter that gcc is warning about, because
the pointed-to types are different.

One could still argue that gcc should ignore pointer-to-nonconst
passed as pointer-to-const (and perhaps the trunk gcc does) but
otherwise the logic is sane - the pointers point to different types.
It's like passing "struct foo *" when the function wants "struct bar *".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019