type-punned waring while compiling FreeRTOS code for AP7000

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am using the NGW100 and FreeRTOS.
I get the following warnings while compiling the FreeRTOS code:

make[1]: Entering directory 

avr32-gcc -c -g port.c mylib.c heap_2.c list.c queue.c tasks.c croutine.c -Os -f
strict-aliasing -Wall -Wfatal-errors -I ../h -I ../Common/h
list.c: In function 'vListInitialise':
list.c:89: warning: dereferencing type-punned pointer will break strict-aliasing
 rules
list.c:97: warning: dereferencing type-punned pointer will break strict-aliasing
 rules
list.c:98: warning: dereferencing type-punned pointer will break strict-aliasing
 rules
list.c: In function 'vListInsert':
list.c:151: warning: dereferencing type-punned pointer will break strict-aliasin
g rules
list.c:159: warning: dereferencing type-punned pointer will break strict-aliasin
g rules
tasks.c: In function 'xTaskCreate':
tasks.c:502: warning: assignment makes integer from pointer without a cast
tasks.c:503: warning: assignment makes integer from pointer without a cast
tasks.c: In function 'vTaskSwitchContext':
tasks.c:1341: warning: dereferencing type-punned pointer will break strict-alias
ing rules
croutine.c: In function 'vCoRoutineSchedule':
croutine.c:291: warning: dereferencing type-punned pointer will break strict-ali
asing rules
make[1]: Leaving directory 
make[1]: Entering directory 
avr32-gcc -c -g BlockQ.c comtest.c crflash.c crhook.c death.c dynamic.c flash.c
flop.c integer.c PollQ.c semtest.c -Os -fstrict-aliasing -Wall -Wfatal-errors -I
 ../h -I ../../h
death.c: In function 'vCreateSuicidalTasks':
death.c:113: warning: pointer targets in passing argument 2 of 'xTaskCreate' dif
fer in signedness
death.c: In function 'vCreateTasks':
death.c:180: warning: pointer targets in passing argument 2 of 'xTaskCreate' dif
fer in signedness
death.c:181: warning: pointer targets in passing argument 2 of 'xTaskCreate' dif
fer in signedness
death.c:183: warning: pointer targets in passing argument 2 of 'xTaskCreate' dif
fer in signedness
death.c:184: warning: pointer targets in passing argument 2 of 'xTaskCreate' dif
fer in signedness
make[1]: Leaving directory 
make[1]: Entering directory 
avr32-gcc -c -g Startup.c -Os -Wall -Wfatal-errors
make[1]: Leaving directory 

make[1]: Entering directory 
avr32-gcc -c -g Downloader.c -Os -Wall -Wfatal-errors

I have incorporated the code to my project. I have not made any changes from the demo project that comes with the FreeRTOS download.

The problem I am facing is that my code crashes sometimes. Meaning if I add some code to the project, with a few variables it crashes.

I create a task, in which one more task is created. These tasks enter the vTaskDelay() for sometime and when they are ready to run, an exception occurs.

Well, can these warnings cause any problem during normal running of the software?
How can these warnings be removed?

I am using optimization level -Os, these warnings go away with -O0.

I have compiled the FreeRTOS code for AT32UC3A0512, using the Framework. It gives similar warnings with -Os.
Has someone run the FreeRTOS code with the optimizations turned ON?

Appreciate any comments,
-drt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you create a task you pass in the name of the task. Cast the name to ( signed char * ) and one of the warnings will go away.

Add the compile time option -fno-strict-aliasing and the other warning will go away too.

See also http://sourceforge.net/tracker/i... - may help.

+ http://www.FreeRTOS.org
The de facto standard, downloaded every 170 second during 2019.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply.
The warnings did go away.

The crashing problem was due to the way the interrupts are mapped in the FreeRTOS demo.

I have started another thread for this:

https://www.avrfreaks.net/index.p...

-drt