Summary
Changing the postp warning matcher so it outputs as an error but ignores warnings around certain files. For example, when compiling third-party code that contains warnings that I have chosen not to resolve, I want any warnings outside of those files to be labeled as a failure to the build.
Solution
-
use –check none to not use any matchers
Here is an example ignoring all matches:postp --check none --loadProperty /myProject/newPostpMatchers
-
Use –ignore.
ignore regular expression pattern: any line in the log file matching this pattern will be skipped without matching it against the matchers. There may be multiple –ignore options.
Here is an example ignoring a warning message:postp --ignore "warning C4244" --loadProperty /myProject/newPostpMatchers
-
Use –dontCheck
Here is an example ignoring a warning message using dontCheck:postp --dontCheck coreDump --loadProperty /myProject/newPostpMatchers
- Create you own matcher that does nothing:
- Create your own matcher.
- Set the pattern to the regex you want to ignore.
- Define the action as empty.
-
Use your matcher in combination with our matcher, making sure that yours is used before ours (“unshift” instead of “push” will do the trick).
my @newMatchers = ( { id => "IgnoredWarnings", pattern => q{warning C4244}, action => "" }, ); unshift @::gMatchers, @newMatchers;
0 Comments