-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Squid Sensor fails to parse files with #define
containing "/*"
#1903
Comments
Hi @Dkapps, Thanks for reporting this. Seems to be a problem with the preprocessor. Regards, |
@Dkapps maybe you can try it with the SSLR toolkit. Do you get the same error there? |
Failing, after void f1() {}
#define BROKEN_DEFINE " /a/path/*"
void f2() {} but seems to be no issue with strings, the one below is working: void f1() { char * txt = " /a/path/*"; }
void f2() {} Tried it with raw string, also fails: void f1() {}
#define BROKEN_DEFINE R"( /a/path/*)"
void f2() {} |
- better support special cases like: ```C++ #define A B/**/C #define A "/**/" #define A B // comment ``` - minor refactoring - close SonarOpenCommunity#1903
@Dkapps it's fixed and you can try it (but only with 2.0). |
Description
Squid sensor seems to silently fail parsing c++ files with a
#define
containing an unmatched "/*".We found out that one of source files was not correctly analyzed when the line of code counter was set to 0.
After an analysis, Squid seems to choke on one of our
#define
.With the original
#define
(code was obfuscated for project confidentiality issues), the sensor silently fails to analyseWith a modified
#define
(but functionnaly identical), the sensor parses the file correctlySteps to reproduce the problem
Please provide the steps required to reproduce the problem
Create a source code file containg a macro with a unmatched "/*"
Analyse it with sonar-scanner
Expected behavior
The file should be analysed correctly
Actual behavior
The sensor silently fails to analyse the code
Known workarounds
Declare a global variable instead of a macro, or split the string containing the "/*"
Related information
1.3.1.1807
7.9.1.27448
The text was updated successfully, but these errors were encountered: