[cfe-dev] Float128 undefined problem

Paulo Matos via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 13 02:26:58 PST 2019


Hi,

I am probably not the first one to see this problem as I can attest by
googling for it. Yet, it's not clear what the issue is.

So, when I build something with clang, I sometimes get:
llvm-project/build/bin/../libexec/ccc-analyzer -O0 -g    -I./..
-I/home/pmatos/Projects/LT-racket/racket/src/build/../racket/gc2/../include
-I/home/pmatos/Projects/LT-racket/racket/src/build/../racket/gc2/../../rktio
-I../../rktio -pthread -I/usr/lib/libffi-3.2.1/include   -DUSE_SENORA_GC
   -c xsrc/error.c -o error.o
In file included from xsrc/env.c:1:
/usr/include/bits/mathcalls-helper-functions.h:21:30: error: unknown
type name '_Float128'
extern int __fpclassifyf128 (_Float128 __value ) __attribute__
((__nothrow__ , __leaf__ ) )
                             ^
/usr/include/bits/mathcalls-helper-functions.h:25:27: error: unknown
type name '_Float128'
extern int __signbitf128 (_Float128 __value ) __attribute__
((__nothrow__ , __leaf__ ) )
                          ^
/usr/include/bits/mathcalls-helper-functions.h:30:25: error: unknown
type name '_Float128'
extern int __isinff128 (_Float128 __value ) __attribute__ ((__nothrow__
, __leaf__ ) ) __attribute__ ((__const__ ) ) ;
                        ^
/usr/include/bits/mathcalls-helper-functions.h:33:26: error: unknown
type name '_Float128'
extern int __finitef128 (_Float128 __value ) __attribute__ ((__nothrow__
, __leaf__ ) ) __attribute__ ((__const__ ) ) ;
                         ^
/usr/include/bits/mathcalls-helper-functions.h:36:25: error: unknown
type name '_Float128'
extern int __isnanf128 (_Float128 __value ) __attribute__ ((__nothrow__
, __leaf__ ) ) __attribute__ ((__const__ ) ) ;
                        ^
/usr/include/bits/mathcalls-helper-functions.h:39:27: error: unknown
type name '_Float128'
extern int __iseqsigf128 (_Float128 __x , _Float128 __y ) __attribute__
((__nothrow__ , __leaf__ ) ) ;
                          ^
/usr/include/bits/mathcalls-helper-functions.h:39:43: error: unknown
type name '_Float128'
extern int __iseqsigf128 (_Float128 __x , _Float128 __y ) __attribute__
((__nothrow__ , __leaf__ ) ) ;
                                          ^
/usr/include/bits/mathcalls-helper-functions.h:42:31: error: unknown
type name '_Float128'
extern int __issignalingf128 (_Float128 __value ) __attribute__
((__nothrow__ , __leaf__ ) )
                              ^
8 errors generated.


This is todays HEAD built on Archlinux compiling the Racket programming
language subsystem. I assume there's some incompatibility of clang/llvm
and some libraries and include headers I have installed, however I can't
really understand what it is. I do know however that I don't use
Float128's in my code.

If I dig deeper I see that the functions in mathcalls-helper-functions.h
are called with _Mdouble argument and this is defined in my math.h as:
#if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)
# define _Mdouble_              _Float128
# define __MATH_PRECNAME(name,r) name##f128##r
# define __MATH_DECLARING_DOUBLE  0
# define __MATH_DECLARING_FLOATN  1
# if __HAVE_DISTINCT_FLOAT128
#  include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
#  include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif

However, I have seen no use of __HAVE_DISTINCT_FLOAT128 or
__HAVE_FLOAT128 in my code. Does anybody have any idea what this is
about? I understand this is probably not directly related to clang
development but at the same time this doesn't happen with gcc, so I am
wondering if there's some internal definition - or lack thereof - that
explains this.

Kind regards,

-- 
Paulo Matos



More information about the cfe-dev mailing list