Tool/software:
Hi,
The following code raise a waning:

> #552-D variable "len" was set but never used
I don't think this is correct.
compiler: TI v20.2.7.LTS
Best,
Gabriel
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi,
The following code raise a waning:

> #552-D variable "len" was set but never used
I don't think this is correct.
compiler: TI v20.2.7.LTS
Best,
Gabriel
The compiler views the code as equivalent to ...
len = 4;
_sst25_spi_send(4, data);
In that case, the variable len is never used.
Thanks and regards,
-George
Hi George,
Thanks for answer.
Considering your example, I can see why the compiler would generate this warning.
I'm raising this issue because this behavior is, as far as I can tell, unusual.
As you can see, we don't see this behavior in the 3 major compilers gcc, clang and msvc:

Having the TI compiler behave differently can cause frictions, in my opinion.
Regards,
Gabriel
I respect your opinion.
At the same time, the handling of compiler diagnostics is not specified in the language standards. That is why the TI Arm compiler supports methods to control many (not all) diagnostics. This particular diagnostic is among those you can control. For instance, it can be suppressed with the option --diag_suppress=552. For details, including yet other methods, please search the TI ARM compiler manual for the sub-chapter titled Understanding Diagnostic Messages.
Thanks and regards,
-George
Ok that make sense. Regarding suppressing the warning, I don't think I want to do that, as it can be useful.
-
From now on, I will considerer this issue as a "feature request" instead of a "bug reports" .
I can also close it as "resolved" if you wish.
Please see the note at the bottom of the first page of the tiarmclang online manual. It says ...
only bug fixes will be provided in maintenance releases of v20.2.x.LTS of the armcl
Since we agree this is feature request and not a bug, it will not be implemented.
If it is practical, consider changing from armcl to tiarmclang.
Thanks and regards,
-George
Make sense.
Thanks for your suggestion. I don't think the new compiler supports the TI Hercules series of MCU.