delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2008/07/16/13:43:45

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Wed, 16 Jul 2008 13:43:42 -0400
Message-Id: <200807161743.m6GHhgeF026876@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <487E2DD0.7080400@iki.fi> (message from Andris Pavenis on Wed, 16
Jul 2008 20:20:16 +0300)
Subject: Re: Fixes for strict aliasing warnings from GCC-4.3.1
References: <487E2DD0 DOT 7080400 AT iki DOT fi>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

We have a union-based trick we use for UNCONST, maybe that would be
cleaner to use than all those casts anyway?

As a bonus, it would avoid the aliasing problems the "right way".

#define unconst(__v, __t) __extension__ ({union { const __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;})

We could define a "as_long" that unions typeof(x) with long.

- Raw text -


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