|GCC extension types [message #1794116]
||Thu, 23 August 2018 21:50
| Andrew Robinson
Registered: August 2018
I'm using Eclipse Neon,2.0, under Gentoo OS.|
The projects I'm building depend on GCC/g++ and the gnu QuadMath library. My projects build from an existing gnu makefile on the command line without errors using g++ 7.3.0-r3.p1.4 and gnumake.
The g++ compiler has an extension type called __float128.
__float128, is therefore a compiler built in type and not a user type.
After installing Eclipse Neon, and importing one of my projects; I noticed that the line numbers on the left margin were marked with numerous errors and missing header file warnings.
I have added all QuatMath headers and system directory paths to Project > Properties > C/C++ General > Preprocessor Includes :: GNU C++, and GNU C
I have also run Project > C/C++ index > Rebuild
All the project errors and syntax warnings disappeared, except:
Type '__float128' could not be resolved
Invalid arguments ...
Where the invalid argument is always __float128
I don't want to create a class of type __float128, as the floating point type is a gnu compiler extension, and not a user data type.
I don't see any help on how to get eclipse CDT to recognize built in types that the compiler has, but which are not in header files.
How can I get eclipse to recognize a nonstandard C/C++ type, __float128, as a type defined by the g++ command line compiler?
|Re: GCC extension types [message #1794248 is a reply to message #1794116]
||Tue, 28 August 2018 04:14
Registered: October 2012
It is not universally supported and may require an option flag during compile.|
It works for me though.
If your code compiles and the problem is just with the Indexer,
you can define it as a preprocessor macro using
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries tab --> CDT User Entries
Select "Add" then "preprocessor macro" in the drop-down.
You'll need to do this for both C++ and C.
Setting "__float128" to "void" will probably work.
Or maybe "float" instead of "void".
Alternately, you could define it in your code with
#define __float128 <whatever>
Or maybe define it as a class instead of a macro.
Powered by FUDForum
. Page generated in 0.04495 seconds