@@ -56,6 +56,25 @@ goto_analyzer_parse_optionst::goto_analyzer_parse_optionst(
56
56
{
57
57
}
58
58
59
+ void goto_analyzer_parse_optionst::set_default_analysis_flags (optionst &options)
60
+ {
61
+ // Checks enabled by default in v6.0+.
62
+ options.set_option (" bounds-check" , true );
63
+ options.set_option (" pointer-check" , true );
64
+ options.set_option (" pointer-primitive-check" , true );
65
+ options.set_option (" div-by-zero-check" , true );
66
+ options.set_option (" signed-overflow-check" , true );
67
+ options.set_option (" undefined-shift-check" , true );
68
+
69
+ // Default malloc failure profile chosen to be returning null.
70
+ options.set_option (" malloc-may-fail" , true );
71
+ options.set_option (" malloc-fail-null" , true );
72
+
73
+ // This is in-line with the options we set for CBMC in cbmc_parse_optionst
74
+ // with the exception of unwinding-assertions, which don't make sense in
75
+ // the context of abstract interpretation.
76
+ }
77
+
59
78
void goto_analyzer_parse_optionst::get_command_line_options (optionst &options)
60
79
{
61
80
if (config.set (cmdline))
@@ -67,7 +86,19 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
67
86
if (cmdline.isset (" function" ))
68
87
options.set_option (" function" , cmdline.get_value (" function" ));
69
88
70
- // all checks supported by goto_check
89
+ // Enable flags that in combination provide analysis with no surprises
90
+ // (expected checks and no unsoundness by missing checks).
91
+ if (!cmdline.isset (" no-standard-checks" ))
92
+ {
93
+ goto_analyzer_parse_optionst::set_default_analysis_flags (options);
94
+ PARSE_OPTIONS_GOTO_CHECK_NEGATIVE_DEFAULT_CHECKS (cmdline, options);
95
+ }
96
+ else if (cmdline.isset (" no-standard-checks" ))
97
+ {
98
+ PARSE_OPTIONS_GOTO_CHECK_POSITIVE_DEFAULT_CHECKS (cmdline, options);
99
+ }
100
+
101
+ // all (other) checks supported by goto_check
71
102
PARSE_OPTIONS_GOTO_CHECK (cmdline, options);
72
103
73
104
// The user should either select:
0 commit comments