As discussed in comments, especially if the numerical macros are not mixed with macros having non-numerical types, it's simple to produce a program that prints their values.
Even though your environment is a cross compiler, this is a useful exercise because all gccs process constant expressions internally with the same code. This does math in extended precision so that compiled constants are within one ULP of the exact value.
So any gcc should give a quite accurate idea of what's going into your code.
In perl:
print "#include<stdio.h>\n";
print "#include \"$ARGV[0]\"\n";
print "#define S(X) #X\n";
print "int main(void) {\n";
open F, $ARGV[0] or die $!;
while (<F>) {
print " printf(\"%s=%.13g\\n\", S($1), (double)$1);\n" if /#define\s+(\w+)\s+\S/;
}
print " return 0;\n}\n";
Now try it out by running on math.h
.
perl /usr/include/math.h > math_h_syms.c
This produces:
#include<stdio.h>
#include "/usr/include/math.h"
#define S(X) #X
int main(void) {
printf("%s=%.13g\n", S(INFINITY), (double)INFINITY);
printf("%s=%.13g\n", S(FP_NAN), (double)FP_NAN);
printf("%s=%.13g\n", S(FP_INFINITE), (double)FP_INFINITE);
printf("%s=%.13g\n", S(FP_ZERO), (double)FP_ZERO);
printf("%s=%.13g\n", S(FP_NORMAL), (double)FP_NORMAL);
printf("%s=%.13g\n", S(FP_SUBNORMAL), (double)FP_SUBNORMAL);
printf("%s=%.13g\n", S(FP_SUPERNORMAL), (double)FP_SUPERNORMAL);
printf("%s=%.13g\n", S(FP_ILOGB0), (double)FP_ILOGB0);
printf("%s=%.13g\n", S(FP_ILOGBNAN), (double)FP_ILOGBNAN);
printf("%s=%.13g\n", S(MATH_ERRNO), (double)MATH_ERRNO);
printf("%s=%.13g\n", S(MATH_ERREXCEPT), (double)MATH_ERREXCEPT);
printf("%s=%.13g\n", S(math_errhandling), (double)math_errhandling);
printf("%s=%.13g\n", S(M_E), (double)M_E);
printf("%s=%.13g\n", S(M_LOG2E), (double)M_LOG2E);
printf("%s=%.13g\n", S(M_LOG10E), (double)M_LOG10E);
printf("%s=%.13g\n", S(M_LN2), (double)M_LN2);
printf("%s=%.13g\n", S(M_LN10), (double)M_LN10);
printf("%s=%.13g\n", S(M_PI), (double)M_PI);
printf("%s=%.13g\n", S(M_PI_2), (double)M_PI_2);
printf("%s=%.13g\n", S(M_PI_4), (double)M_PI_4);
printf("%s=%.13g\n", S(M_1_PI), (double)M_1_PI);
printf("%s=%.13g\n", S(M_2_PI), (double)M_2_PI);
printf("%s=%.13g\n", S(M_2_SQRTPI), (double)M_2_SQRTPI);
printf("%s=%.13g\n", S(M_SQRT2), (double)M_SQRT2);
printf("%s=%.13g\n", S(M_SQRT1_2), (double)M_SQRT1_2);
printf("%s=%.13g\n", S(MAXFLOAT), (double)MAXFLOAT);
printf("%s=%.13g\n", S(FP_SNAN), (double)FP_SNAN);
printf("%s=%.13g\n", S(FP_QNAN), (double)FP_QNAN);
printf("%s=%.13g\n", S(HUGE), (double)HUGE);
printf("%s=%.13g\n", S(X_TLOSS), (double)X_TLOSS);
printf("%s=%.13g\n", S(DOMAIN), (double)DOMAIN);
printf("%s=%.13g\n", S(SING), (double)SING);
printf("%s=%.13g\n", S(OVERFLOW), (double)OVERFLOW);
printf("%s=%.13g\n", S(UNDERFLOW), (double)UNDERFLOW);
printf("%s=%.13g\n", S(TLOSS), (double)TLOSS);
printf("%s=%.13g\n", S(PLOSS), (double)PLOSS);
return 0;
}
Compiling and running:
INFINITY=inf
FP_NAN=1
FP_INFINITE=2
FP_ZERO=3
FP_NORMAL=4
FP_SUBNORMAL=5
FP_SUPERNORMAL=6
FP_ILOGB0=-2147483648
FP_ILOGBNAN=-2147483648
MATH_ERRNO=1
MATH_ERREXCEPT=2
math_errhandling=2
M_E=2.718281828459
M_LOG2E=1.442695040889
M_LOG10E=0.4342944819033
M_LN2=0.6931471805599
M_LN10=2.302585092994
M_PI=3.14159265359
M_PI_2=1.570796326795
M_PI_4=0.7853981633974
M_1_PI=0.3183098861838
M_2_PI=0.6366197723676
M_2_SQRTPI=1.128379167096
M_SQRT2=1.414213562373
M_SQRT1_2=0.7071067811865
MAXFLOAT=3.402823466385e+38
FP_SNAN=1
FP_QNAN=1
HUGE=3.402823466385e+38
X_TLOSS=1.414847550406e+16
DOMAIN=1
SING=2
OVERFLOW=3
UNDERFLOW=4
TLOSS=5
PLOSS=6