Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Indexer issues with shared C/C++ headers

Mike you should open a bug and provide a template project and code that displays the issue with the bug.  You are much more likely to have an answer.

 

Guy

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Mike Wrighton
Sent: Thursday, August 08, 2013 10:02 AM
To: CDT General developers list.
Subject: [cdt-dev] Indexer issues with shared C/C++ headers

 

Hi,

 

I've come across an indexer issue when a C++ project contains both C and C++ source files that share the same header. Specifically, the issue is when the header does this:

 

#if defined(__cplusplus)

extern "C" {

#endif

<declare something>

#if defined(__cplusplus)

}

#endif

 

It looks like the indexer treats the __cplusplus macro as being true across all source files in a C++ project, so the thing declared in the above statement will not be visible in the C sources that include that header, since the extern "C" statement is invalid.

 

I don't know how the indexer works, but would it be possible for it to evaluate the __cplusplus macro per source file, according to the source file type?

 

Thanks,

Mike


Back to the top