GCC screws up pointer->ulong conversion on 32 bit systems

Johannes Pfau nospam at example.com
Sun Dec 1 05:15:17 PST 2013


Am Sun, 24 Nov 2013 12:50:43 +0100
schrieb "Iain Buclaw" <ibuclaw at ubuntu.com>:

> 
> Apparently it's working as per C semantics, which means the 
> behavior is undefined.  I've mentioned that it makes no sense 
> that documentation/code don't match comments. But all I've heard 
> back is that you shouldn't use convert_to_integer in the front 
> end (except maybe through convert() - which I am 90% certain is 
> the case with us), and to implement our own semantics if we say 
> that pointer to integer conversion is clearly defined in D.
> 
> Regards
> Iain.

We actually use convert_to_integer directly, but anyway, here's the
fix:
https://github.com/jpf91/GDC/commit/c3e19f8e79c9b47bff29fd9a5be8de1c69af3ee5

Fixing it in the frontend has the benefit that we don't have to patch
gcc so maybe it's even better this way.

( I guess merging the ARM branch should probably wait till the 2.064
merge is finished, right? )


More information about the D.gnu mailing list