Why does Visual Studio 2008 highlight internal as a keyword in C ++ code?

I am porting VC ++ 7 code to VC ++ 9. Surprisingly, Visual Studio 2008 highlights the internal as a keyword in C ++ code, but it seems that in fact it is not considered as such.

What is it - an error in VS, setting up an environment that I have not yet found, or a sign that I will no longer be allowed to use the internal as a regular identifier in any future version? What is my best move in this situation?

+6
c ++ visual-c ++ visual-studio
source share
3 answers

Just ignore it. The "problem" is that not all parts of Visual Studio correctly distinguish between C ++ and C ++ / CLI. Therefore, some C ++ / CLI keywords stand out even in regular C ++. ( array is another).

This only affects syntax highlighting, not the actual compiler.

Thus, the only reason to avoid these words is that you 1) find the syntax too irritated or 2) plan to port your application to C ++ / CLI.

+5
source share

I'm not sure, but I think the internal specifier can be used in C ++ / CLI projects. Thus, since there is only a difference between one project parameter between a project other than C ++ / CLI and a C ++ / CLI project, therefore it may be that for this reason it is highlighted.

[Edit] Just checked, the internal IS keyword is in C ++ / CLI and generates a similar IL for the one that was generated by the C # project. So my initial thinking seems right. This seems to be one parser for all C ++ flavors from Microsoft.

+7
source share

The problem is that the parser used for extraction is not one of the real C ++ parsers. "One of" because VC ++, C ++ / Za and C ++ / CLI are three dialects with different parsers. The VS printer makes extensive use of a common parser, which is not always correct. For example. it has one set of keywords, so it always assumes that β€œinternal” is a keyword.

+3
source share

All Articles