Home:ALL Converter>two or more data types in declaration specifiers for typedef float _Float32;

two or more data types in declaration specifiers for typedef float _Float32;

Ask Time:2019-02-24T01:04:04         Author:kmartinho

Json Formatter

I'm porting a pretty old C (and a bit of C++) code basis from KEIL OS to Linux 32 bit.

When compiling with gcc/g++ 6.3 to 6.5 it works ok, when trying to do the same with gcc > 7.0 (tested with 7.3 and 8.2 on ubuntu 18.04) I get compilation errors:

/usr/include/bits/floatn-common.h:207:15: error: two or more data types in declaration specifiers
 typedef float _Float32;
               ^~~~~~~~
/usr/include/bits/floatn-common.h:244:16: error: two or more data types in declaration specifiers
 typedef double _Float64;
                ^~~~~~~~
/usr/include/bits/floatn-common.h:261:16: error: two or more data types in declaration specifiers
 typedef double _Float32x;
                ^~~~~~~~~
/usr/include/bits/floatn-common.h:278:21: error: two or more data types in declaration specifiers
 typedef long double _Float64x;

The compiler header (/usr/include/bits/floatn-common.h:261:16) file contains the following part:

# if __HAVE_FLOAT32

#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
typedef float _Float32;
#  endif

#  if !__GNUC_PREREQ (7, 0)
#   define __builtin_huge_valf32() (__builtin_huge_valf ())
#   define __builtin_inff32() (__builtin_inff ())
#   define __builtin_nanf32(x) (__builtin_nanf (x))
#   define __builtin_nansf32(x) (__builtin_nansf (x))
#  endif

# endif

Which tells me that this is only related to gcc > 7.0

most of the issues related to this error are missing ";" in structs or doing something like

void int myFunction(void){}

though I think this is not the case here because it appears in different compilation units and it works with previous versions of gcc/g++

using glibc version 2.27

My question: is there a way to disable this new compiler feature or eventually a hint from the community where to start searching

Author:kmartinho,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54843947/two-or-more-data-types-in-declaration-specifiers-for-typedef-float-float32
yy