File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -968,10 +968,10 @@ def misra_12_4(data):
968968
969969def misra_13_1 (data ):
970970 for token in data .tokenlist :
971- if token . str != '=' :
971+ if not simpleMatch ( token , '] = {' ) :
972972 continue
973- init = token .next
974- if init and init . str == '{' and hasSideEffectsRecursive (init ):
973+ init = token .next . next
974+ if hasSideEffectsRecursive (init ):
975975 reportError (init , 13 , 1 )
976976
977977
Original file line number Diff line number Diff line change @@ -218,10 +218,12 @@ void misra_12_4() {
218218 x = 123456u * 123456u ; // 12.4
219219}
220220
221+ struct misra_13_1_t { int a ; int b ; };
221222void misra_13_1 (int * p ) {
222223 volatile int v ;
223224 int a [3 ] = {0 , (* p )++ , 2 }; // 13.1
224- int b [2 ] = {v ,1 }; // TODO
225+ int b [2 ] = {v ,1 };
226+ struct misra_13_1_t c = { .a = 4 , .b = 5 }; // no fp
225227}
226228
227229void misra_13_3 () {
You can’t perform that action at this time.
0 commit comments