Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313933 - grey out "#ifdef" sections when define not set / active configuration dependend
Summary: grey out "#ifdef" sections when define not set / active configuration dependend
Status: RESOLVED DUPLICATE of bug 313944
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 5.0.1   Edit
Hardware: PC Linux Qt
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 11:59 EDT by clemens CLA
Modified: 2010-05-21 13:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description clemens CLA 2010-05-21 11:59:25 EDT
Build Identifier: M20080911-1700

When I have a C/C++ Project and there is code with #ifdef then this code is only NOT greyed out when I define the used DEFINE in all configurations.

Example:

Code is:
#ifdef FOOBAR
 printf("123");
#endif

This code is greyed out normally. Then I go to "Project/Properties/C/C++ General/Paths and Symbols" and there in "symbols" and then a make "add" Name = FOOBAR and make a check in "add to all configurations" and then press OK.
After this, the code is not greyed out any more. (This is what I expect.)

But if I don't set the check in "add to all configurations" and then I set the configuration active, where I have added the define (using "Project/Build Configurations/Set active") the code stays greyed out.

Reproducible: Always

Steps to Reproduce:
1. add the define to only one configuration (i.e. DEBUG)
2. set the configuration from "1." to active
Comment 1 Andrew Gvozdev CLA 2010-05-21 12:51:33 EDT
If you want Active build configuration to sync with indexer or other UI you need to set in project properties->"C/C++ General"->Indexer->"Build configuration for the indexer"->"Use active build configuration".
This might be counter-intuitive but that is how it works. Please, see bug 247021 comment#12 for some justification.
Comment 2 Andrew Gvozdev CLA 2010-05-21 13:17:24 EDT
Again, I totally agree that it is very confusing. I created a bug to make it hopefully less confusing.

*** This bug has been marked as a duplicate of bug 313944 ***