(self, data)
| 3925 | ifStack.pop() |
| 3926 | |
| 3927 | def misra_21_1(self, data): |
| 3928 | re_forbidden_macro = re.compile(r'#(?:define|undef) _[_A-Z]+') |
| 3929 | re_macro_name = re.compile(r'#(?:define|undef) (.+)[ $]') |
| 3930 | |
| 3931 | for d in data.directives: |
| 3932 | # Search for forbidden identifiers |
| 3933 | m = re.search(re_forbidden_macro, d.str) |
| 3934 | if m: |
| 3935 | self.reportError(d, 21, 1) |
| 3936 | continue |
| 3937 | |
| 3938 | # Search standard library identifiers in macro names |
| 3939 | m = re.search(re_macro_name, d.str) |
| 3940 | if not m: |
| 3941 | continue |
| 3942 | name = m.group(1) |
| 3943 | if isStdLibId(name, data.standards.c): |
| 3944 | self.reportError(d, 21, 1) |
| 3945 | |
| 3946 | def misra_21_2(self, cfg): |
| 3947 | for directive in cfg.directives: |
nothing calls this directly
no test coverage detected