freertos: Compilerwarnung

Gast #1682305
Lesenswert?

Ich hab auf einen Mikrocontroller das Echtzeitbetriebssystem freertos 
portiert. Beim übersetzen erscheint folgende Fehlermeldung:

Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 652
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 658
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 713
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 719
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 1578
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 1578
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 1579
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 1634
Warning: undefined behavior: the order of volatile accesses is undefined 
in this statement C:\Entwicklung\freertos\tasks.c 1639

Was bedeutet eigentlich genau diese Warnung? Was könnte ich tun, damit 
diese Warnung nicht wieder erscheinen tut?
Angehängte Dateien:
Gast #1682384
Lesenswert?

Line 652:
1
vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );

Line 658:
1
vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );

Line 713:
1
vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );

Line 719:
1
vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );

Line 1578 und 1579:
1
taskFIRST_CHECK_FOR_STACK_OVERFLOW();
2
taskSECOND_CHECK_FOR_STACK_OVERFLOW();

Line 1634:
1
vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );

Line 1639:
1
vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
#1682424
Lesenswert?

Sowohl pxOverflowDelayedTaskList als auch pxCurrentTCB sind volatile?

Die Warnung besagt, dass die Reihenfolge, in welcher auf die 
Volatile-Variablen zugegriffen wird, so nicht definiert ist. Der 
Compiler ist frei sich seine "Lieblingsreihenfolge" auszuwählen.

Da volatile-Variablen für Memory-Mapped IO, IO-Ports, etc verwendet 
werden, kann das ein Problem sein.

Wenn es kein Problem ist, dann trägt vermutlich eine oder beide 
Variablen das Volatile zu unrecht.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren