Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331179 - C/C++ Indexer report error for #error (valid pre-processor directive)
Summary: C/C++ Indexer report error for #error (valid pre-processor directive)
Status: RESOLVED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-26 01:43 EST by Sudarshan V CLA
Modified: 2010-12-02 05:43 EST (History)
0 users

See Also:


Attachments
Snapshot contains the location where IASTProblem is created for valid #error preprocessor directive (54.81 KB, image/jpeg)
2010-11-26 01:47 EST, Sudarshan V CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarshan V CLA 2010-11-26 01:43:46 EST
Build Identifier:  I20100608-0911

<#error "some text"> is a valid pre-processor statement. When a C-file containing this code fragment is opened in the CEditor, there is an annotation against this code fragment which reports this as invalid. 

This is due to the fact that in the CPreProcessor class, IASTProblem is created always when #error is encountered. This is incorrect.

Reproducible: Always

Steps to Reproduce:
1. Open a C-file in C-Editor containing code fragment #error "some text"
2. Editor shows a C/C++ Indexer Marker Annotation which is incorrect since #error "some text" is a valid pre-processor statement
Comment 1 Sudarshan V CLA 2010-11-26 01:47:39 EST
Created attachment 183901 [details]
Snapshot contains the location where IASTProblem is created for valid #error preprocessor directive

Snapshot contains the location where IASTProblem is created for valid #error preprocessor directive
Comment 2 Markus Schorn CLA 2010-12-02 05:43:41 EST
The directive is valid syntax. However, when an #error directive is found in an active code-branch the program will not compile. Therefore, in such a situation, you do look at a problem that is worth being annotated.