Add appended messages to the save/restore concept
We are linting our complete software with different rulesets for its different SW-parts (because some are safety relevant and some are not, i.e. the rulesets differ, but the code analysis must check the software as a whole).
Each SW-part's rulesets has its own active rules/errors + specific messages for the errors, which are added via the "-append()" option.
In the course of action we use the save/restore options to get back to a basic common, global configuration.
I.e. the complete command line is something like:
lint-nt.exe
<output file>
<global base cfg>
<msg output format cfg>.lnt
(n-times) x [
<SW-part specific cfg => first option: -save>.lnt
<SW-part specific includes>.lnt
<SW-part specific target files (.c, .h) => last option: -restore >.lnt
]
While this works well for the error inhibition, with this command call structure finally in the PC-lint log, the latter SW-parts get also all appended messages from the previous ones, i.e. the "-append()" options are not saved/restored with the active errors.
For example in the following PC-lint-log-snippet only the last MISRA category should be added:
FINDING_DETAILS§"d:\80-Software\src\Module12345.c"§8002§80§Note§9033§Impermissible cast of composite expression (wider essential type for the destination) §MISRA-C:2012 Rule 10.8§ required, §MISRA-C:2012 Rule 10.8§ advisory, §MISRA-C:2012 Rule 10.8§ obligatory)
<<
PC-lint Plus provides options to save and restore entire option environments, include append options, using the -env_push/-env_pop and -env_save/-env_restore options.