__flash qualifier not recognized


I am currently setting up a project with GCC-AVR, and I am getting a code smell Track parsing failures c:S2260: unknown type name '__flash'

__flash const myType_t my_array[5] = {0, 1, 2, 3, 4};

__flash is used by GCC-AVR to force a variable in the flash. Named Address Spaces (Using the GNU Compiler Collection (GCC))

Since it is failing at finding the qualifier __flash, it also fails at recognizing the declared variable, and produces more code smells.

Is there a way to make it work correctly with Sonarqube ?

Thank you.

Hey there.

As requested in the template post, what version of SonarQube are you using?


Sorry about that; I am using Sonarqube Developer Edition - Version 10.1 (build 73491)

1 Like

Hi @JBertrandRSE,

It is true that we dont recognise this compiler specific.
We worked recently on improving our analyzer to handle better compiler intrinsics that aren’t understood by the analyzer.

This work is going to be realeased as part of SonarQube 10.2 in two weeks. I suggest marking the inaccuracy as a false-positive and going back to this thread if you still face inaccuracy in the results after upgrading to 10.2.

Meanwhile, i will look on my side if we can support __flash and keep you updated.


1 Like


I had a deeper look at our code, and it seems that we already support __flash with some specific compilers. Maybe we don’t with yours. To investigate further can you send me the analysis full debug logs and the build-wrapper or compilation database content?

I will send you a PM where you can upload the logs.

I can also confirm that the false-positive will definitely be fixed with 10.2, you can already experiment with the new version on Godbolt and see how we don’t raise error on __fast and we can understand the code.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.