Sonar tells me:
Make the type of this variable a pointer-to-const. The current type of “btn” is “struct button_dev *”.
BUT,
btn-> makes writes to the btn which is intended.
making btn a pointer to -const does not make sense here.
This looks like another potential false positive. It might be due to a parsing error (missing include file, non-standard syntax, etc.). You can see parsing errors by activating the debug log.
I didn’t succeed in reproducing the issue on my side so do you think you could create a small reproducer for it?
To generate a reproducer file:
Add the reproducer option to the scanner configuration:
sonar.cfamily.reproducer= "Full path to the button.c file"
Re-running the scanner should generate a file named sonar-cfamily.reproducer in the project folder.
Please share this file (I can send you a PM if you want to share it privately)
I’m looking forward to nail down this false positive!
@franz_at_zasso , I’m closing the topic. Feel free to open another one with additional information I requested if you are still encountering the issue.