incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: quiet gcc warnings
Date Fri, 27 Nov 2009 18:10:06 GMT
On Fri, Nov 27, 2009 at 09:04:27AM -0600, Peter Karman wrote:
> Not sure that this merits a JIRA ticket, but this little patch quiets a gcc warning:

>  #elif (SIZEOF_PTR == 8)
> -    size_t address = self;
> +    size_t address = (size_t)self;

Hmm, is that 100% right?  The existing code is definitely wrong and needs
fixing, but I can never remember all the ways that pointer-to-integer and
integer-to-pointer conversion can go screwy.  There are some really weird
truncation effects on some systems.

Probably what we ought to do is rely on macros *every* time we need to convert
between integers and pointers.  The conversion macros would be implemented in
Charmonizer and would get thorough testing.

There's already a PTR2I64 macro in Charmonizer/Probe/Integers, but we probably
need a larger menu:


Marvin Humphrey

View raw message