File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3327,6 +3327,9 @@ def misra_config(self, data):
33273327 end_token = tok .link
33283328 while tok != end_token :
33293329 tok = tok .next
3330+ if tok .str == 'sizeof' and tok .next .str == '(' :
3331+ tok = tok .next .link
3332+ continue
33303333 if tok .str == "(" and tok .isCast :
33313334 tok = tok .link
33323335 continue
@@ -4254,6 +4257,7 @@ def setSuppressionList(self, suppressionlist):
42544257 self .addSuppressedRule (ruleNum )
42554258
42564259 def report_config_error (self , location , errmsg ):
4260+ errmsg = 'Because of missing configuration, misra checking is incomplete. There can be false negatives! ' + errmsg
42574261 cppcheck_severity = 'error'
42584262 error_id = 'config'
42594263 if self .settings .verify :
Original file line number Diff line number Diff line change @@ -2035,3 +2035,13 @@ static void misra_22_10(void)
20352035 f = strtod (inStr , NULL_PTR );
20362036 if (errno != 0 ) {}
20372037}
2038+
2039+ // #12448
2040+ static void check_misra_config (void )
2041+ {
2042+ if (sizeof (struct bar ) == 0U ) {} //no warning
2043+ if (sizeof (int abc ) == 0U ) {} //no warning
2044+ if (sizeof (xyz ) == 0U ) {} //no warning
2045+ if (sizeof (const pqr ) == 0U ) {} //no warning
2046+ if (sizeof (const int * const pqrs ) == 0U ) {} //no-warning
2047+ }
You can’t perform that action at this time.
0 commit comments