in my code I have lines like
volatile uint32_t* const pulSystimeS = (uint32_t* )0x12345678;
to get the value of an internal counter of my CPU. for this line sonar created the issue
*# Make the type of this variable a pointer-to-const. The current type of “pulSystimeS” is "volatile unsigned long const".
but I have no idea why, because the value is a volatile value which cannot be a constant. Is the an idea how I can solve this issue or is it a bug in the developer version of the C sensor?
I’m using the Developer Edition - Version 9.7.1 (build 62043) of SonarQube …
Welcome to the community!
Your version is past EOL. Can you upgrade and see if this is still replicable? Your upgrade path is:
9.7.1 → 9.9 → 10.1 (last step optional)
You may find these resources helpful:
If you have questions about upgrading, feel free to open a new thread for that here.
meanwhile we have updated to v.9.9.1 but unfortunately the behavior hasn’t changed.
Is there anything else I can do to help to solve the problem?
Thanks for confirming. I’ve flagged this for the language experts.
Hi @Ralf_Ebert ,
Indeed we have a false positive on this rule. I created a ticket to fix this.
Thanks for raising the issue!