During compilation tests with gcc, I noticed that several macros from
fenv.h and ieeefp.h are conflicting, e.g.:
In file included from /usr/obj/usr/src/tmp/usr/include/ieeefp.h:13, from /usr/src/lib/msun/tests/exponential_test.c:41: /usr/obj/usr/src/tmp/usr/include/machine/ieeefp.h:111:1: error: "__fldcw" redefined In file included from /usr/src/lib/msun/tests/exponential_test.c:35: /usr/obj/usr/src/tmp/usr/include/fenv.h:98:1: error: this is the location of the previous definition In file included from /usr/obj/usr/src/tmp/usr/include/ieeefp.h:13, from /usr/src/lib/msun/tests/exponential_test.c:41: /usr/obj/usr/src/tmp/usr/include/machine/ieeefp.h:112:1: error: "__fldenv" redefined In file included from /usr/src/lib/msun/tests/exponential_test.c:35: /usr/obj/usr/src/tmp/usr/include/fenv.h:99:1: error: this is the location of the previous definition In file included from /usr/obj/usr/src/tmp/usr/include/ieeefp.h:13, from /usr/src/lib/msun/tests/exponential_test.c:41: /usr/obj/usr/src/tmp/usr/include/machine/ieeefp.h:114:1: error: "__fnstcw" redefined In file included from /usr/src/lib/msun/tests/exponential_test.c:35: /usr/obj/usr/src/tmp/usr/include/fenv.h:105:1: error: this is the location of the previous definition In file included from /usr/obj/usr/src/tmp/usr/include/ieeefp.h:13, from /usr/src/lib/msun/tests/exponential_test.c:41: /usr/obj/usr/src/tmp/usr/include/machine/ieeefp.h:115:1: error: "__fnstenv" redefined In file included from /usr/src/lib/msun/tests/exponential_test.c:35: /usr/obj/usr/src/tmp/usr/include/fenv.h:104:1: error: this is the location of the previous definition In file included from /usr/obj/usr/src/tmp/usr/include/ieeefp.h:13, from /usr/src/lib/msun/tests/exponential_test.c:41: /usr/obj/usr/src/tmp/usr/include/machine/ieeefp.h:116:1: error: "__fnstsw" redefined In file included from /usr/src/lib/msun/tests/exponential_test.c:35: /usr/obj/usr/src/tmp/usr/include/fenv.h:106:1: error: this is the location of the previous definition *** [exponential_test.o] Error code 1 make[6]: stopped in /usr/src/lib/msun/tests
Unfortunately the macros in fenv.h and ieeefp.h are *not* compatible, as
the former usually take direct variables, while the latter take pointers.
In rS321483, @ngie worked around this by disabling warnings on macro
redefinitions, stating "this is a bandaid until the code is fixed and
will be reverted before MFC", but obviously that never happened.
To properly fix this, I propose to prefix the clashing macros from
fenv.h with __fenv, and those from ieeefp.h with __ieeefp, so the
headers can both be included without conflicts.