Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356761

Summary: Compiler symbols do not make the right active/inactive code
Product: [Tools] CDT Reporter: Erwin Mueller <devent>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: CLOSED DUPLICATE QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: major    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Erwin Mueller CLA 2011-09-06 03:12:31 EDT
Build Identifier: 20110615-0604

I'm using different build configurations for my C project, and for different configurations I have symbols like LINUX or WINDOWS active. 

But if I choose a different configuration the inactive code stays the same, i.e. the code is with gray background color. But the compiler will compile the right code and the editor will highlight the right compiler errors in the text (it will compile the gray inactive code and it will show compiler errors in the gray code).

Reproducible: Always

Steps to Reproduce:
1. Create 2 configurations, configuration A with symbol LINUX, configuration B with symbol WINDOWS
2. Create code with #ifdef LINUX xxx and #ifdef WINDOWS xxx
3. switch to configuration A
4. code inside the #ifdef WINDOWS is marked as inactive and code inside #ifdef LINUX is active
5. switch to configuration B
6. code inside the #ifdef WINDOWS is still marked as inactive, but will compile
Comment 1 Anton Leherbauer CLA 2011-09-06 04:25:17 EDT

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