File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ jobs:
146146 ./cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
147147 cd addons/test
148148 ../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64 && python3 ../misra.py -verify misra/misra-test.c.dump
149+ ../../cppcheck --addon=misra --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
149150
150151 - name : Build GUI on ubuntu
151152 if : contains(matrix.os, 'ubuntu')
Original file line number Diff line number Diff line change @@ -568,19 +568,19 @@ def getEssentialType(expr):
568568def bitsOfEssentialType (ty ):
569569 if ty is None :
570570 return 0
571- ty = ty .split (' ' )[- 1 ]
572- if ty == 'Boolean' :
571+ last_type = ty .split (' ' )[- 1 ]
572+ if last_type == 'Boolean' :
573573 return 1
574- if ty == 'char' :
574+ if last_type == 'char' :
575575 return typeBits ['CHAR' ]
576- if ty == 'short' :
576+ if last_type == 'short' :
577577 return typeBits ['SHORT' ]
578- if ty == 'int' :
578+ if last_type == 'int' :
579579 return typeBits ['INT' ]
580- if ty == 'long' :
581- return typeBits ['LONG' ]
582- if ty == 'long long' :
580+ if ty .endswith ('long long' ):
583581 return typeBits ['LONG_LONG' ]
582+ if last_type == 'long' :
583+ return typeBits ['LONG' ]
584584 for sty in STDINT_TYPES :
585585 if ty == sty :
586586 return int ('' .join (filter (str .isdigit , sty )))
Original file line number Diff line number Diff line change 1+ // To test:
2+ // ~/cppcheck/cppcheck --addon=misra --platform=avr8 misra-test-avr8.c
3+
4+ static void misra_12_2 (void ) {
5+ a = (((uint64_t )0xFF ) << 32 );
6+ }
7+
You can’t perform that action at this time.
0 commit comments