Community
Participate
Working Groups
Created attachment 275110 [details] Settings dialogs Hello, In C/C++ General/Code Analysis, then Coding Style/ Name convention for function, I customized the settings, as shown in the joined screen grab. I added some exceptions to my rule, but for stream operators (operator<< and operator>>), these exceptions are ignored.
Note you can see the offening code in the lower left corner of the screen grab.
Does it work if in the exception list, you add a space after "operator", as in "operator <<"?
It does work !!! Thanks !
Well, I reopen it the issue. The user should have to know this trick...
The reason this happens is that in CDT's internal representation of the code (the index), operator names are normalized to have a space between the "operator" token and the operator symbol. This is a formatting style used in some codebases, so we can't just change the normalized form to have no space, because then we'd just run into the opposite problem. Rather, the Code Analysis component should take what the user inputs, and perform the normalization on it (that is, add the space if it's not present) so it matches the form stored in the index. Harry, would you be interested in contributing a patch that does this? I'm happy to point you to the relevant code.
(I fixed a similar problem with Search and Open Element a few years ago, in bug 408870.)
No problems with the code, but I hope I won't have troubles with the Eclipse process for contribution... I use it once to patch docs, ant it was SO heavy. :)
Documentation on setting up your environment and contributing can be found here: https://wiki.eclipse.org/Getting_started_with_CDT_development
Codewise I believe you want to look at NamingConventionFunctionChecker.isFilteredArg().
I use now CDT 10.4.0. I doesn't have anymore the problem with the stream operators (it may have disappeared before 10.4.0). But I get error with any function which doesnt start with a capital letter, even if in Preferences > C/C++ > Code Analysis, "Name convention for function" is disabled (an even if it would be enabled, the severity should be Info, and not Error).