A’ha, you fell into my evil trap J.
 
This problem affects everything. We have
always had the problem with whether to treat header files as C or C++. As far
as I know, this is the only use of the ccnature that we have. If you are a C++
project, we treat them as C++ files, if you are a C project, they are C.
 
However going forward, I’d like to
see a much better solution, possibly based on the toolchain associated with the
active build config. Or something. I am just getting the feeling we need to
revisit our contentType structure in general. I’d like to see content
types tell me the language variant as well, e.g. gnu c++ file. But I’m
not sure if that’s the right way to go either. More investigation and
discussion required here.
 
Doug
 
From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Treggiari, Leo
Sent: Friday, December 09, 2005
12:43 PM
To: CDT General developers list.
Subject: [cdt-dev] Header content
types
 
 
Hi,
 
While
investigating other things, I ran into a problem with our content-type
definitions for a Header file.  
 
   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cHeader"
       file-extensions="h"/>
   </extension> 
 
   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cxxHeader"
       file-extensions="hpp,hh,hxx"/>
   </extension> 
 
cHeader contains “h”.
cxxHeader contains “hpp,hh,hxx”.
 
Shouldn’t cxxHeader also include
“h”?  We have the g++ Tool defined to use the cxxHeader
content-type.  So, if I ask if a .h file is a header file for this Tool,
the answer is No.  Can anyone think of a reason why we should not add
“h” to the C++ header extensions list?
 
Thanks,
Leo