12 #ifndef CPROVER_ANSI_C_GOTO_CHECK_C_H
13 #define CPROVER_ANSI_C_GOTO_CHECK_C_H
40 #define OPT_GOTO_CHECK \
41 "(bounds-check)(pointer-check)(memory-leak-check)(memory-cleanup-check)" \
42 "(div-by-zero-check)(float-div-by-zero-check)" \
43 "(enum-range-check)" \
44 "(signed-overflow-check)(unsigned-overflow-check)" \
45 "(pointer-overflow-check)(conversion-check)(undefined-shift-check)" \
46 "(float-overflow-check)(nan-check)(no-built-in-assertions)" \
47 "(pointer-primitive-check)" \
48 "(retain-trivial-checks)" \
50 "(no-assertions)(no-assumptions)" \
51 "(assert-to-assume)" \
52 "(no-bounds-check)(no-pointer-check)(no-signed-overflow-check)" \
53 "(no-pointer-primitive-check)(no-undefined-shift-check)" \
54 "(no-div-by-zero-check)"
57 #define HELP_GOTO_CHECK \
58 " {y--no-standard-checks} \t disable default checks (more information in manpage)\n" \
59 " {y--bounds-check} \t enable array bounds checks (default on)\n" \
60 " {y--no-bounds-check} \t disable array bounds checks\n" \
61 " {y--pointer-check} \t enable pointer checks (default on)\n" \
62 " {y--no-pointer-check} \t disable pointer checks\n" \
63 " {y--memory-leak-check} \t enable memory leak checks\n" \
64 " {y--memory-cleanup-check} \t enable memory cleanup checks\n" \
65 " {y--div-by-zero-check} \t " \
66 "enable division by zero checks on integers (default on)\n" \
67 " {y--float-div-by-zero-check} \t " \
68 "enable division by zero checks on floating-point numbers (default off)\n" \
69 " {y--no-div-by-zero-check} \t disable division by zero checks\n" \
70 " {y--signed-overflow-check} \t " \
71 "enable signed arithmetic over- and underflow checks (default on)\n" \
72 " {y--no-signed-overflow-check} \t " \
73 "disable signed arithmetic over- and underflow checks\n" \
74 " {y--unsigned-overflow-check} \t " \
75 "enable arithmetic over- and underflow checks\n" \
76 " {y--pointer-overflow-check} \t " \
77 "enable pointer arithmetic over- and underflow checks\n" \
78 " {y--conversion-check} \t " \
79 "check whether values can be represented after type cast\n" \
80 " {y--undefined-shift-check} \t check shift greater than bit-width " \
82 " {y--no-undefined-shift-check} \t disable check for shift greater than " \
84 " {y--float-overflow-check} \t check floating-point for +/-Inf\n" \
85 " {y--nan-check} \t check floating-point for NaN\n" \
86 " {y--enum-range-check} \t " \
87 "checks that all enum type expressions have values in the enum range\n" \
88 " {y--pointer-primitive-check} \t " \
89 "checks that all pointers in pointer primitives are valid or null (default " \
91 " {y--no-pointer-primitive-check} \t " \
92 "disable checks that all pointers in pointer primitives are valid or null\n" \
93 " {y--retain-trivial-checks} \t include checks that are trivially true\n" \
94 " {y--error-label} {ulabel} \t check that label {ulabel} is unreachable\n" \
95 " {y--no-built-in-assertions} \t ignore assertions in built-in library\n" \
96 " {y--no-assertions} \t ignore user assertions\n" \
97 " {y--no-assumptions} \t ignore user assumptions\n" \
98 " {y--assert-to-assume} \t convert user assertions to assumptions\n"
101 #define PARSE_OPTION_OVERRIDE(cmdline, options, option) \
102 if(cmdline.isset(option)) \
103 options.set_option(option, true); \
104 if(cmdline.isset("no-" option)) \
105 options.set_option(option, false); \
109 #define PARSE_OPTIONS_GOTO_CHECK(cmdline, options) \
110 options.set_option("memory-leak-check", cmdline.isset("memory-leak-check")); \
111 options.set_option("memory-cleanup-check", cmdline.isset("memory-cleanup-check"));
\
112 options.set_option("enum-range-check", cmdline.isset("enum-range-check")); \
113 options.set_option("unsigned-overflow-check", cmdline.isset("unsigned-overflow-check"));
\
114 options.set_option("pointer-overflow-check", cmdline.isset("pointer-overflow-check"));
\
115 options.set_option("conversion-check", cmdline.isset("conversion-check")); \
116 options.set_option("float-overflow-check", cmdline.isset("float-overflow-check"));
\
117 options.set_option("nan-check", cmdline.isset("nan-check")); \
118 options.set_option("built-in-assertions", !cmdline.isset("no-built-in-assertions"));
\
119 options.set_option("retain-trivial-checks", \
120 cmdline.isset("retain-trivial-checks")); \
121 options.set_option("assertions", !cmdline.isset("no-assertions"));
\
122 options.set_option("assumptions", !cmdline.isset("no-assumptions"));
\
123 options.set_option("assert-to-assume", cmdline.isset("assert-to-assume"));
\
124 options.set_option("retain-trivial", cmdline.isset("retain-trivial"));
\
125 if(cmdline.isset("error-label")) \
126 options.set_option("error-label", cmdline.get_values("error-label")); \
127 PARSE_OPTION_OVERRIDE(cmdline, options, "bounds-check"); \
128 PARSE_OPTION_OVERRIDE(cmdline, options, "pointer-check"); \
129 PARSE_OPTION_OVERRIDE(cmdline, options, "div-by-zero-check"); \
130 PARSE_OPTION_OVERRIDE(cmdline, options, "float-div-by-zero-check"); \
131 PARSE_OPTION_OVERRIDE(cmdline, options, "signed-overflow-check"); \
132 PARSE_OPTION_OVERRIDE(cmdline, options, "undefined-shift-check"); \
133 PARSE_OPTION_OVERRIDE(cmdline, options, "pointer-primitive-check"); \
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A collection of goto functions.
::goto_functiont goto_functiont
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
void goto_check_c(const namespacet &ns, const optionst &options, goto_functionst &goto_functions, message_handlert &message_handler)
Goto Programs with Functions.