[PATCH] D40673: Add _Float128 as alias to __float128 to enable compilations on Fedora27/glibc2-26

James Greenhalgh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 06:26:16 PST 2017


jgreenhalgh added a comment.

If this patch unconditionally defines _Float128, then I think it will conflict with the typedef for _Float128 for IEEE754 128-bit long double systems in glibc:

  /* The type _Float128 exists only since GCC 7.0.  */
  #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
  typedef long double _Float128;
  #  endif

https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/ieee754/ldbl-128/bits/floatn.h;hb=HEAD

This manifests on AArch64 as compile time failure as so:

  $ cat x.c
  #include <stdlib.h>
  $ clang  x.c
  In file included from x.c:1:
  In file included from /usr/include/stdlib.h:55:
  /usr/include/aarch64-linux-gnu/bits/floatn.h:67:21: error: cannot combine with previous 'double' declaration specifier
  typedef long double _Float128;
                      ^
  1 error generated.

I think that is an inadequate guard check in glibc, but perhaps there is something clang can do to help out?

Thanks,
James


Repository:
  rC Clang

https://reviews.llvm.org/D40673





More information about the cfe-commits mailing list