0

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.

PascalS
  • 975
  • 1
  • 16
  • 40

1 Answers1

1

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.

bamos
  • 506
  • 4
  • 8
  • _get rid of them_ ... Thats my problem. They are generated by the STM32Cube and I can't get rid of them ;) – PascalS Nov 07 '19 at 07:16
  • I think using Cube for anything more than a glorified example creator is the 1st problem ;-) Granted, I haven't had great experience with it (or STM HAL) over the years. . . and I wish STM would bring back the Standard Peripheral Library. . . – bamos Nov 07 '19 at 07:41
  • Ok, understood :D – PascalS Nov 07 '19 at 08:02