Skip to content

Commit 615af61

Browse files
committed
Support __float128 with GCC on Apple Silicon
Although not officially documented it seems that GCC running on Apple Silicon accepts __float128 as a keyword. Fixes: #8305
1 parent 2a5151c commit 615af61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ansi-c/ansi_c_internal_additions.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ void ansi_c_internal_additions(std::string &code, bool support_float16_type)
268268
code+="typedef long double __float128;\n";
269269
}
270270
}
271+
else if(
272+
config.ansi_c.arch == "arm64" &&
273+
config.ansi_c.os == configt::ansi_ct::ost::OS_MACOS &&
274+
config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG &&
275+
config.ansi_c.gcc__float128_type)
276+
{
277+
// https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html doesn't say so,
278+
// but GCC on macOS supports __float128 also for Apple Silicon. It really
279+
// appears to be a keyword, but we don't handle GCC version+platform
280+
// specifics in the scanner.
281+
code += "typedef " CPROVER_PREFIX "Float128 __float128;\n";
282+
}
271283

272284
if(
273285
config.ansi_c.arch == "i386" || config.ansi_c.arch == "x86_64" ||

0 commit comments

Comments
 (0)