Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Inactive code highlight does not work in *.h file(It seems to work on *.c file though)
Inactive code highlight does not work in *.h file [message #762069] Wed, 07 December 2011 14:05 Go to next message
Missing name Missing nameFriend
Messages: 7
Registered: December 2011
Junior Member
Hi all,

I am using Eclipse Platform 3.7.0 Indigo. I use Eclipse only as Editor, use
make separately, (Green Hills compiler for MIPS).

I am using some of the Defines that are used in make file to use the
Inactive Code highlight feature. I add the defines in:
Project->Properties->C/C++ General -> Paths and Symbols -> Symbols -> GNU C-> Add

As example, I have a define in make file as "-DCFG_FUNC_ON",

I add in the Symbol->Add->Name : CFG_FUNC_ON (Value empty).

Now, in a *.c file I have this:

#ifdef CFG_FUNC_ON
...some Code, which Eclipse shows as ACTIVE
#endif

in a *.h file, I have this:

#ifdef CFG_FUNC_ON
...some Code, which Eclipse shows as INACTIVE, as Grey colored.
#endif

Why doesnt Eclipse show the code Active in header files ? What do I need to do ?

# If I add in one of my header files the same define as
#define CFG_FUNC_ON
then Eclipse shows the code both in *.c and *.h file as ACTIVE.

Thank you.
Re: Inactive code highlight does not work in *.h file [message #763126 is a reply to message #762069] Fri, 09 December 2011 08:22 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
I guess Eclipse treats your header as a C++ file.
Is this header included by C++ files, too?
Is the header unused?
=> In Project Properties->C/C++ General->Indexer there is the option "Index unused headers as C++ files".

You can add the symbol to the C++ part
Project->Properties->C/C++ General -> Paths and Symbols -> Symbols -> GNU C++


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Inactive code highlight does not work in *.h file [message #766105 is a reply to message #763126] Thu, 15 December 2011 08:35 Go to previous messageGo to next message
Dawid  is currently offline Dawid Friend
Messages: 4
Registered: December 2011
Junior Member
Hello,

I've got similar problem, I am using Eclipse Platform 3.7.0 Indigo and I use it as a IDE with external provided makefile and builder, I was wonder is it possible to download all defines from makefile to the IDE in order to remove inactive code parts in my app. It would be great if download will be performed during build.

regards
Dawid
Re: Inactive code highlight does not work in *.h file [message #766117 is a reply to message #766105] Thu, 15 December 2011 08:52 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Dawid wrote on Thu, 15 December 2011 09:35
Hello,

I've got similar problem, I am using Eclipse Platform 3.7.0 Indigo and I use it as a IDE with external provided makefile and builder, I was wonder is it possible to download all defines from makefile to the IDE in order to remove inactive code parts in my app. It would be great if download will be performed during build.

regards
Dawid

Scanner discovery will just do this. When you build your program it will scan the build output for defines.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Inactive code highlight does not work in *.h file [message #766715 is a reply to message #766117] Fri, 16 December 2011 10:00 Go to previous messageGo to next message
Dawid  is currently offline Dawid Friend
Messages: 4
Registered: December 2011
Junior Member
Thanks a lot for quick response, I don't know yet what it is, so I must read some manuals about it;) Thanks a lot for tipps.

Regards
Dawid
Re: Inactive code highlight does not work in *.h file [message #766716 is a reply to message #766117] Fri, 16 December 2011 10:00 Go to previous messageGo to next message
Dawid  is currently offline Dawid Friend
Messages: 4
Registered: December 2011
Junior Member
Thanks a lot for quick response, I don't know yet what it is, so I must read some manuals about it;) Thanks a lot for tipps.

Regards
Dawid
Re: Inactive code highlight does not work in *.h file [message #766718 is a reply to message #766117] Fri, 16 December 2011 10:00 Go to previous message
Dawid  is currently offline Dawid Friend
Messages: 4
Registered: December 2011
Junior Member
Thanks a lot for quick response, I don't know yet what it is, so I must read some manuals about it;) Thanks a lot for tipps.

Regards
Dawid
Previous Topic:Beginner - Eclipse C++ : some methods not found
Next Topic:How do I set a header file to be seen from everywhere?
Goto Forum:
  


Current Time: Thu Apr 25 02:00:46 GMT 2024

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

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

Back to the top