[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-patch] Automated JUnit test
|
>
> The C/C++ flag has come about due to defects in how we parse C code. C++
> Keywords like "this" and "template" are valid identifiers in C, and the
> parser was getting awefully confused in scenarios where these identifiers
> were used in declarations. Unless there is a way of determining if a
> particular header file is C code rather than C++, we have no alternative but
> to check the nature of the project that the header resides within. This
> test utility must call IParser::setCppNature( false ) in order to ensure
> that we properly parse C code within a project/directory.
>
Right, this is what the editor is actually doing(or should be doing, if not PR please),
when in doubt. But it is part of the problem, C++ headers filenames does not
necessarly have an extension. Say
string
iostream
...
A few solution, I'm looking at:
- a small database of the "known" headers as define in ISO C++ standard.
- And a way to add/remove to the database on preference/project basis.
So the database is prefill with filename that a confirming ISO C++ application
should not use in a project:
string
iostream
fstream
etc ..
Comments on any stategy on how to deal with this are welcome.