#include <stdio.h>
-#if !(defined(__STDC__) || defined(__cplusplus))
-/* Only for use in function parameter lists and as function return type. */
-#define void
-#endif
-
typedef int boolean;
#define TRUE 1
#define FALSE 0
}
#define check(type,typeprefix,typestr,equalfn,mainfn) \
-static boolean equalfn (type* x, type* y); \
+static boolean equalfn (volatile type* x, volatile type* y); \
static void mainfn (void) \
{ \
int mant_bits; \
} \
printf("\n"); \
} \
-static boolean equalfn (type* x, type* y) { return *x == *y; } \
+static boolean equalfn (volatile type* x, volatile type* y) \
+{ \
+ return *x == *y; \
+} \
check(float,"float","float",equal_float,main_float)
check(double,"double","double",equal_double,main_double)
static void flipped_double (void)
{
typedef struct { unsigned lo, hi; } dfloat;
- double x = 2;
- dfloat test = *(dfloat*)&x;
+ union { dfloat eksplicit; double machine_double; } x;
+ x.machine_double = 2;
+ dfloat test = x.eksplicit;
if (test.lo==0 && test.hi!=0) {
printf("#define double_wordorder_bigendian_p 0\n");
} else if (test.lo!=0 && test.hi==0) {
#endif
flipped_double();
- if (ferror(stdout)) return 1;
+ if (ferror(stdout) || fclose(stdout)) return 1;
return 0;
}