Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GCC extension types(Getting Eclipse CDT to recognize compiler specific extensions for syntax checking)
GCC extension types [message #1794116] Thu, 23 August 2018 21:50 Go to next message
Andrew Robinson is currently offline Andrew RobinsonFriend
Messages: 2
Registered: August 2018
Junior Member
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 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It is not universally supported and may require an option flag during compile.
https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html

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
#ifdef __CDT_PARSER__
#define __float128 <whatever>
#endif

Or maybe define it as a class instead of a macro.
Previous Topic:Unable to debug with Neon and TDM-GCC
Next Topic:Attempting to debug Qt gui app with Eclipse
Goto Forum:
  


Current Time: Wed Apr 24 22:20:41 GMT 2024

Powered by FUDForum. Page generated in 0.02907 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top