Mail Archives: djgpp-workers/2003/04/22/09:23:44
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 -