Ignore line to remove parsing error in SonarLint/SonarQube


(Wesley Crelly) #1

Hello everyone,

I’m trying to ignore a line in my C code due to it causing a file parse issue using SonarLint with Eclipse (TI Code Composer). Is there a way to do this? I also want to ensure that it will be ignored on our SonarQube server analysis.

Note, my exact issue occurs with the non-standard “__interrupt” keyword extension.

Thanks for any help,

(Julien Henry) #2


That’s not possible to ignore just a line. You should exclude the entire file from the analysis.


(Wesley Crelly) #3

Thank you for your response, Julien.

I’m working embedded code where there are a few compiler/product specific keywords. If I exclude files, I could be excluding a lot of the code base for a few lines of code. Right now, my team has just been commenting out the lines so the file will parse locally. For now we’ll continue this tactic. The only other way that I can see would be to try moving most of the offending code to a single file and ignoring it as you noted, but I’d rather not as that would require structuring our code to fit the tool and not the other way around.

(Julien Henry) #4

Hi @Wes

Changing your code to please SonarLint is not a good long term solution if the code is correct. It would be better if you could share a reproducer (sample code, compiler details, …), so that we can try to improve our analyzer.

(Wesley Crelly) #5

Hi @Julien_HENRY
Sorry for the late reply, but I suspect that a TI non-bios C2000 example project could be used. Unfortunately, I am not at liberty to give that code, but the compiler that we currently use is TI v18.1.5 LTS

Again, the only parsing issue that we saw was the non-bios keyword for __interrupt. Right now, we are moving away from this so it hasn’t been a large issue.

Thanks for your concern!