0
votes

I'm using STM32Cube to generate an IAR EW 8.2 project with FreeRTOS 10.0.1 and CMSISv2 API's. When I clean up the project and build again, I get the following warnings

Warning[Pe177]: variable "hTask" was declared but never referenced

Warning[Pe177]: variable "hTimer" was declared but never referenced

Warning[Pe177]: variable "hEventGroup" was declared but never referenced

Warning[Pe177]: variable "hSemaphore" was declared but never referenced

Warning[Pe177]: variable "hQueue" was declared but never referenced

I know that these warnings should not affect my code but I would be interested if this warnings are always there or if they depend on my settings.

1

1 Answers

1
votes

These are warnings being generated by IAR's compiler. They'll go away after those variables are used. If they aren't used. . . get rid of them and the warnings will also go away ;-) Dead code is never a good thing to keep around! Specifically, you should really consider treating warnings more like errors, since it will force a cleaner code base.

If you really want to supress warnings, you can mask individual warnings in IAR: 1. Select Project-->Options-->Compiler tab 2. Select Suppress these diagnostics and specify your desired warning 3. Click OK.