Skip to content

Commit

Permalink
undo parts of diffblue#2185
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kroening committed Jun 6, 2018
1 parent e040723 commit 78794e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
9 changes: 9 additions & 0 deletions regression/cbmc/ts18661_typedefs/main.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#if defined(__clang__)
#elif defined(__GNUC__)
#if __GNUC__ >= 7
#define HAS_FLOATN
#endif
#endif

#ifndef HAS_FLOATN
typedef float _Float32;
typedef double _Float32x;
typedef double _Float64;
typedef long double _Float64x;
typedef long double _Float128;
typedef long double _Float128x;
#endif

int main(int argc, char** argv) {
}
19 changes: 3 additions & 16 deletions src/ansi-c/ansi_c_convert_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,22 +346,9 @@ void ansi_c_convert_typet::write(typet &type)
gcc_float64_cnt+gcc_float64x_cnt+
gcc_float128_cnt+gcc_float128x_cnt>=2)
{
// Temporary workaround for our glibc versions that try to define TS 18661
// types (for example, typedef float _Float32). This can be removed once
// upgrade cbmc's GCC support to at least 7.0 (when glibc will expect us
// to provide these types natively), or disable parsing them ourselves
// when our preprocessor stage claims support <7.0.
if(c_storage_spec.is_typedef)
{
warning().source_location = source_location;
warning() << "ignoring typedef for TS 18661 (_FloatNNx) type. If you need these, try using goto-cc instead." << eom;
}
else
{
error().source_location=source_location;
error() << "conflicting type modifiers" << eom;
throw 0;
}
error().source_location=source_location;
error() << "conflicting type modifiers" << eom;
throw 0;
}

// _not_ the same as float, double, long double
Expand Down

0 comments on commit 78794e2

Please sign in to comment.