FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2009 Threads] Warnings in tasks.c 5.4.1 IARPosted by Geoff Kruse on July 28, 2009 I receive the following warnings in tasks.c in freertos 5.4.1 in IAR arm 5.20 for cortex-m3:
Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 611 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 617 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 672 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 678 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 1551 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 1593 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 1598 Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement freeRTOS\tasks.c 1970
While these warnings seem to have no ill effects, our internal coding standard prohibits having any warnings in our code. Any thoughts on the proper way to resolve these warnings?
RE: Warnings in tasks.c 5.4.1 IARPosted by Richard on July 29, 2009 The warning is quite correct, but as far as I recall from inspection, also quite benign. It comes from trying to support lots of different compilers, all of which generate warnings in different and sometimes contradictory ways.
You could try casting away the volatile from one or other side of the statement.
I will take a look at the code lines again to see what can be done. In the provided demos I think you will find the warning is just switched off.
Regards.
RE: Warnings in tasks.c 5.4.1 IARPosted by RachelAdamec on February 2, 2011 I ended up satisfying this warning by forcing the order in which these variables were accessed:
xList xlXList; xListItem xliXListItem; ... if( xTimeToWake < xTickCount ) { /* Wake time has overflowed. Place this item in the overflow list. */ xlXList = *((xList *) pxOverflowDelayedTaskList); xliXListItem = *((xListItem *) &( pxCurrentTCB->xGenericListItem )); vListInsert( &xlXList, &xliXListItem); } else { /* The wake time has not overflowed, so we can use the current block list. */ xlXList = *((xList *) pxDelayedTaskList); xliXListItem = *((xListItem *) &( pxCurrentTCB->xGenericListItem )); vListInsert( &xlXList, &xliXListItem); }
wouldn't this be 'better' than just turning off the warning?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|