On Fri, 30 Jan 2015, Leon Alrae wrote: > > @@ -760,6 +760,6 @@ static inline int float128_is_any_nan(fl > > > > /*---------------------------------------------------------------------------- > > | The pattern for a default generated quadruple-precision NaN. > > > > *----------------------------------------------------------------------------*/ > > -extern const float128 float128_default_nan; > > +__inline__ float128 float128_default_nan(void); > > > > Unfortunately clang complains about it and eventually it won't link: > > CC aarch64-softmmu/target-arm/helper-a64.o > In file included from /qemu/target-arm/helper-a64.c:20: > In file included from /qemu/target-arm/cpu.h:37: > In file included from /qemu/include/qemu-common.h:120: > In file included from /qemu/include/qemu/bswap.h:8: > /qemu/include/fpu/softfloat.h:485:20: warning: inline function > 'float32_default_nan' is not defined [-Wundefined-inline] > __inline__ float32 float32_default_nan(void); > ^ > /qemu/target-arm/helper-a64.c:345:19: note: used here > nan = float32_default_nan(); > ^ > In file included from /qemu/target-arm/helper-a64.c:20: > In file included from /qemu/target-arm/cpu.h:37: > In file included from /qemu/include/qemu-common.h:120: > In file included from /qemu/include/qemu/bswap.h:8: > /qemu/include/fpu/softfloat.h:597:20: warning: inline function > 'float64_default_nan' is not defined [-Wundefined-inline] > __inline__ float64 float64_default_nan(void); > ^ > /qemu/target-arm/helper-a64.c:374:19: note: used here > nan = float64_default_nan(); > ^ > 2 warnings generated. > CC aarch64-softmmu/target-arm/gdbstub64.o > CC aarch64-softmmu/target-arm/crypto_helper.o > GEN trace/generated-helpers.c > CC aarch64-softmmu/trace/generated-helpers.o > LINK aarch64-softmmu/qemu-system-aarch64 > fpu/softfloat.o: In function `commonNaNToFloat64': > /qemu/fpu/softfloat-specialize.h:796: undefined reference to > `float64_default_nan' > /qemu/fpu/softfloat-specialize.h:805: undefined reference to > `float64_default_nan' > fpu/softfloat.o: In function `commonNaNToFloatx80': > /qemu/fpu/softfloat-specialize.h:1007: undefined reference to > `floatx80_default_nan' > /qemu/fpu/softfloat-specialize.h:1014: undefined reference to > `floatx80_default_nan'
Hmm, so perhaps my idea for a later improvement: > Eventually we might want to move the new inline functions into a > separate header to be included from softfloat.h instead of softfloat.c, > but let's make changes one step at a time. will actually have to be made right away. I suspect GCC is more liberal here due to its convoluted extern/static/inline semantics history. Sigh... Maciej