delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/04/22/09:23:44

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3EA53652.200F23BD@phekda.freeserve.co.uk>
Date: Tue, 22 Apr 2003 13:32:18 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Yet another try on nan in strto{f,d,ld}
References: <200304220902 DOT LAA06094 AT lws256 DOT lu DOT erisoft DOT se> <968-Tue22Apr2003144023+0300-eliz AT elta DOT co DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> > From: Martin Stromberg <Martin DOT Stromberg AT epl DOT ericsson DOT se>
> > Date: Tue, 22 Apr 2003 11:02:14 +0200 (MET DST)
[snip]
> > > Also, I'm a bit worried by the typecast juggling you do: won't that
> > > get in our way when/if we want to add ``restrict'' qualifiers to the
> > > library sources and headers?
> >
> > Do you mean "unconst" or "return *(double *)(&n)"? Or something else?
> 
> I mean the plain typecasts, like this:
> 
>     +    double_t n = *(double_t *)(&tmp_d);
> 
> or this:
> 
>     +   return *(double *)(&n);
[snip]

As I understand it, restrict'ed variables are strictly aliased.

FWIW gcc 3.3 complains about these kind of casts breaking strict aliasing: the
warning "type punning breaks strict aliasing" , or something like that. That's
why (IIRC) src/libc/ansi/stdio/(doprnt.c|doscan.c) stop CVS compiling with gcc
3.3.

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


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