Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1416946092.5054.69.camel@eris.loria.fr>
Date: Tue, 25 Nov 2014 21:08:12 +0100
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 1/4] the CMPLX macros must be usable in
 initializations of static variables

Am Dienstag, den 25.11.2014, 16:25 +0100 schrieb Szabolcs Nagy:
> * Jens Gustedt <Jens.Gustedt@...ia.fr> [2014-11-25 15:49:39 +0100]:
> > +#define __CMPLX(x, y, t) ((t)(x) + _Complex_I*(t)(y))
> >  
> 
> this is only correct if the compiler supports annex g kind of
> imaginary type, otherwise it is incorrect for infinites

even then it would only work by using _Imaginary_I, I think

> _Complex_I*INFINITY == (0 + i)*(inf + i*0) == nan + i*inf
> 
> so imaginary inf will turn into nan real part

right

(but I think it is more import to get initialization of normal complex
constants going, than the border cases with INFINITY and NAN)

to support this it seems that gcc provides __builtin_complex, so we
could implement this subject to some case analysis according to
__builtin_const etc. But since the doc for __builtin_complex
explicitly mentions C11, this probably doesn't exist for older
versions of gcc.

I'll think of it and prepare a new version of this patch

Thanks

Jens


-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::



Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.