Skip to main content



      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 09:05 Go to next message
Eclipse UserFriend
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 03:22 Go to previous messageGo to next message
Eclipse UserFriend
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++
Re: Inactive code highlight does not work in *.h file [message #766105 is a reply to message #763126] Thu, 15 December 2011 03:35 Go to previous messageGo to next message
Eclipse UserFriend
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 03:52 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Inactive code highlight does not work in *.h file [message #766715 is a reply to message #766117] Fri, 16 December 2011 05:00 Go to previous messageGo to next message
Eclipse UserFriend
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 05:00 Go to previous messageGo to next message
Eclipse UserFriend
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 05:00 Go to previous message
Eclipse UserFriend
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: Fri Jul 18 23:07:35 EDT 2025

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

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

Back to the top