SQ 7.5 C++ NamespaceName


(Tom) #1

After upgrading from 7.4 developer version to 7.5 developer version, I have changed no settings in the qaulity profile but there are now errors in the scan log see below.

repetition-operator operand invalid
INFO: [pool-4-thread-4] ~~~File Name here~~~
ERROR: The rule with key 'NamespaceName' is configured with an invalid POSIX regex, and will be disabled:

Error on POSIX regex for the "NamespaceName" rule?
(Loïc Joly) #2

Hello @tjnashq,

Indeed, in SonarCFamily 6.0 (the version that comes with SonarQube 7.5), we changed the regular expression engine used for all rules with a regex parameter. It used to take as input a Java regex, but now takes a POSIX regex.

In your case, I think the following regex should be equivalent to what you had before: [a-z_0-9]*.

(Tom) #3

Hi Loïc,

Thank you for getting back to me.

I will try the updated with the updated regex that you mentioned.

I had assumed that as I had not changed the regex from the default values in a previous version, that the default value would be replace with the new default value in V7.5.


(Loïc Joly) #4

Hi @tjnashq,

This is true, but it looks like in that case, at some time, you changed the default value. You are checking for [a-z_0-9]*+ while the default value for this parameter is [a-z][a-z_0-9]* (or [a-z][a-z_0-9]*+ with the old syntax). Which means that the default value does not allow a namespace starting with _, while you do.