Skip to content

Commit 6291b9b

Browse files
committed
Tolerate TS 18661 (_Float32 et al) types
Because we currently claim GCC 4.2.1 support, but also define the TS 18661 floating point types, we confuse Glibc 2.27+, which checks for GCC >= 7.0 and otherwise defines the types itself. In the long run we should either upgrade our support to GCC 7.0 standard, or else stop providing these types and simply ask users interested in these types to use Glibc 2.27 or provide their own headers; in the meantime this workaround permits us to avoid crashing whenever math.h is included.
1 parent ac6eb21 commit 6291b9b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ansi-c/ansi_c_convert_type.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,17 @@ void ansi_c_convert_typet::write(typet &type)
344344
gcc_float64_cnt+gcc_float64x_cnt+
345345
gcc_float128_cnt+gcc_float128x_cnt>=2)
346346
{
347-
error().source_location=source_location;
348-
error() << "conflicting type modifiers" << eom;
349-
throw 0;
347+
if(c_storage_spec.is_typedef)
348+
{
349+
warning().source_location = source_location;
350+
warning() << "ignoring typedef for TS 18661 (_FloatNNx) type" << eom;
351+
}
352+
else
353+
{
354+
error().source_location=source_location;
355+
error() << "conflicting type modifiers" << eom;
356+
throw 0;
357+
}
350358
}
351359

352360
// _not_ the same as float, double, long double

0 commit comments

Comments
 (0)