Bug 270319

Summary: "new" parsed as keyword in C sources although it is not even reserved
Product: [Applications] kdevelop Reporter: Michal Srb <michalsrb>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: aleixpol
Priority: NOR    
Version: 4.0.0   
Target Milestone: 4.2.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Michal Srb 2011-04-07 13:51:33 UTC
Version:           4.0.0
OS:                Linux

Hi, I love to use kdevelop to examine source code of open source projects. They are mostly written in C.
They are sometimes using variables called "new". It is legal in C as "new" is not keyword or reserved word (AFAIK), but it confuses kdevelop's parser and so the navigation and code completion is not so useful in them.

I would never use a variable called "new" in my project, however it is quite often used in already existing ones. Is it possible to parse "new" as normal name when in C source?

Reproducible: Always

Steps to Reproduce:
Use variable called "new" in C source.



It can be partly workarounded by adding this line on the top of source:
#define new new_
Comment 1 Milian Wolff 2011-04-08 13:47:43 UTC
there is no support for plain C yet

*** This bug has been marked as a duplicate of bug 57156 ***
Comment 2 Aleix Pol 2011-04-13 17:44:00 UTC
That bug is related to the Kate highlighting, it's not about C being supported, I think it should be re-assigned to Kate.
Comment 3 Michal Srb 2011-04-13 17:53:58 UTC
(In reply to comment #2)
> That bug is related to the Kate highlighting, it's not about C being supported,
> I think it should be re-assigned to Kate.

No, the basic C highlighting is working correctly (the "new" word is not bold). I was just complaining about the kdevelop parser.

I didn't know that plain C is not supported.
Comment 4 Aleix Pol 2011-04-13 18:42:35 UTC
Ok, sorry. I withdraw my comment then :).
Comment 5 Aleix Pol 2013-03-31 00:47:06 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively