Skip to content

Commit 7e8e9fd

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 8bab263 commit 7e8e9fd

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
@@ -259,6 +259,18 @@ void ansi_c_internal_additions(std::string &code, bool support_float16_type)
259259
code+="typedef long double __float128;\n";
260260
}
261261
}
262+
else if(
263+
config.ansi_c.arch == "arm64" &&
264+
config.ansi_c.os == configt::ansi_ct::ost::OS_MACOS &&
265+
config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG &&
266+
config.ansi_c.gcc__float128_type)
267+
{
268+
// https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html doesn't say so,
269+
// but GCC on macOS supports __float128 also for Apple Silicon. It really
270+
// appears to be a keyword, but we don't handle GCC version+platform
271+
// specifics in the scanner.
272+
code += "typedef " CPROVER_PREFIX "Float128 __float128;\n";
273+
}
262274

263275
if(
264276
config.ansi_c.arch == "i386" || config.ansi_c.arch == "x86_64" ||

0 commit comments

Comments
 (0)