Skip to content

Commit 0b5faa4

Browse files
author
Daniel Kroening
committed
bugfix: __float128
1 parent 4cb2afa commit 0b5faa4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/ansi-c/ansi_c_internal_additions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ void ansi_c_internal_additions(std::string &code)
196196
config.ansi_c.arch=="x86_64" ||
197197
config.ansi_c.arch=="x32")
198198
{
199-
if(config.ansi_c.mode == configt::ansi_ct::flavourt::CLANG)
200-
code+="typedef double __float128;\n"; // clang doesn't do __float128
199+
// clang doesn't do __float128
200+
// Note that this is a typedef and not a keyword.
201+
if(config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG)
202+
code+="typedef long double __float128;\n";
201203
}
202204

203205
// On 64-bit systems, both gcc and clang have typedefs

src/cpp/cpp_internal_additions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ void cpp_internal_additions(std::ostream &out)
127127
config.ansi_c.arch == "x32")
128128
{
129129
// clang doesn't do __float128
130-
if(config.ansi_c.mode == configt::ansi_ct::flavourt::CLANG)
131-
out << "typedef double __float128;" << '\n';
130+
// Note that this is a typedef and not a keyword.
131+
if(config.ansi_c.mode != configt::ansi_ct::flavourt::CLANG)
132+
out << "typedef long double __float128;" << '\n';
132133
}
133134

134135
// On 64-bit systems, gcc has typedefs

0 commit comments

Comments
 (0)