-
Notifications
You must be signed in to change notification settings - Fork 5
Add flag for root cause diagnostic output #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// Limit emitted root causes to those that effect more than one pointer | ||
// or are in the main file of the TU. Alternatively, don't filter causes | ||
// if -warn-all-root-cause is passed. | ||
if (WarnAllRootCause || SM.isInMainFile(SL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are in the main file then you will output the warning even if there's just one wild pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case main file is per translation unit, so for converting vsftpd, the main files are all the c
files passed in as command line arguments. The idea is that all wild pointers in these files are interesting whereas a wild pointer in an included header file that doesn't cause wildness anywhere else is generally not interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Merge when ready (only comments were about comments).
This pull requests adds a command line flag to print the root cause of wildness information that was previously being used in the clangd interactive mode.
Example usage:
cconv-standalone -alltypes -warn-root-cause fptrarrstructcallee.c > /dev/null
The default output with
-warn-root-cause
filters out root causes located in header files that are only responsible for one wild pointer. If you want to see all root causes, I've also added-warn-all-root-cause
to disable this filtering.I've also made two tweaks to constraint generation that improve the root cause output: