Skip to content

Commit 2169a39

Browse files
committed
Add _Float128 spelling for 128-bit float type
According to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html, "On i386, x86_64, PowerPC, and IA-64 other than HP-UX, __float128 is an alias for _Float128" and we support __float128
1 parent f9af374 commit 2169a39

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

regression/ansi-c/gcc_types_compatible_p1/main.c

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ STATIC_ASSERT(__builtin_types_compatible_p(typeof (hot) *, int *));
6767
STATIC_ASSERT(__builtin_types_compatible_p(typeof (hot), typeof (janette)));
6868
STATIC_ASSERT(__builtin_types_compatible_p(__int128, signed __int128));
6969

70+
#ifndef __clang__
71+
// clang doesn't have these
72+
#if defined(__x86_64__) || defined(__i386__)
73+
STATIC_ASSERT(__builtin_types_compatible_p(__float128, _Float128));
74+
#endif
75+
#endif
76+
7077
/* Incompatible types */
7178

7279
STATIC_ASSERT(!__builtin_types_compatible_p(char, _Bool));

src/ansi-c/scanner.l

+2-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ void ansi_c_scanner_init()
466466
return make_identifier();
467467
}
468468

469-
"__float128" { // clang doesn't have it
469+
"__float128" |
470+
"_Float128" { // clang doesn't have it
470471
if(PARSER.mode==configt::ansi_ct::flavourt::GCC)
471472
{ loc(); return TOK_GCC_FLOAT128; }
472473
else

0 commit comments

Comments
 (0)