Get rid of strict aliasing rule violations from libm (#3069)

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
Csaba Osztrogonác
2019-10-01 14:37:18 +02:00
committed by Robert Fancsik
parent f7391a94ae
commit 3763ac8371
16 changed files with 246 additions and 197 deletions
+27 -4
View File
@@ -48,13 +48,36 @@
#endif /* !__LITTLE_ENDIAN */
#ifdef __LITTLE_ENDIAN
#define __HI(x) *(1 + (int *) &x)
#define __LO(x) *(int *) &x
#define __HI(x) *(1 + (const int *) &x)
#define __LO(x) *(const int *) &x
typedef union
{
double dbl;
struct
{
int lo;
int hi;
} as_int;
} double_accessor;
#else /* !__LITTLE_ENDIAN */
#define __HI(x) *(int *) &x
#define __LO(x) *(1 + (int *) &x)
#define __HI(x) *(const int *) &x
#define __LO(x) *(1 + (const int *) &x)
typedef union
{
double dbl;
struct
{
int hi;
int lo;
} as_int;
} double_accessor;
#endif /* __LITTLE_ENDIAN */
#ifndef NAN
#define NAN (0.0/0.0)
#endif
/*
* ANSI/POSIX
*/