Value stored to 'adc_reading ' is never read

This code:

in the line:

adc_reading /= NO_OF_SAMPLES;

i get a Value stored to 'adc_reading ’ is never read

but in fact the Variable is read in Line 104.

how to solve ?

Hi @franz_at_zasso

Thanks for reporting this potential false positive.
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 adc1_example_main.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)

Thank you

Hi @franz_at_zasso
Please let me know if you still experience the issue. In the absence of a reply, I’ll close this topic.

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

@franz_at_zasso , I’m closing the topic. Feel free to open another one with additional information I requested if you still encountering the issue.