@@ -94,27 +94,12 @@ void goto_check_c(
9494 " {y--assert-to-assume} \t convert user assertions to assumptions\n "
9595// clang-format on
9696
97- // clang-format off
98- #define PARSE_OPTIONS_GOTO_CHECK_NEGATIVE_DEFAULT_CHECKS (cmdline, options ) \
99- options.set_option(" bounds-check" , !cmdline.isset(" no-bounds-check" )); \
100- options.set_option(" pointer-check" , !cmdline.isset(" no-pointer-check" )); \
101- options.set_option(" div-by-zero-check" , !cmdline.isset(" no-div-by-zero-check" )); \
102- options.set_option(" signed-overflow-check" , !cmdline.isset(" no-signed-overflow-check" )); /* NOLINT(whitespace/line_length) */ \
103- options.set_option(" undefined-shift-check" , !cmdline.isset(" no-undefined-shift-check" )); /* NOLINT(whitespace/line_length) */ \
104- options.set_option(" pointer-primitive-check" , !cmdline.isset(" no-pointer-primitive-check" )); /* NOLINT(whitespace/line_length) */ \
105- (void ) 0 ;
106- // clang-format on
107-
108- // clang-format off
109- #define PARSE_OPTIONS_GOTO_CHECK_POSITIVE_DEFAULT_CHECKS (cmdline, options ) \
110- options.set_option(" bounds-check" , cmdline.isset(" bounds-check" )); \
111- options.set_option(" pointer-check" , cmdline.isset(" pointer-check" )); \
112- options.set_option(" div-by-zero-check" , cmdline.isset(" div-by-zero-check" )); \
113- options.set_option(" signed-overflow-check" , cmdline.isset(" signed-overflow-check" )); /* NOLINT(whitespace/line_length) */ \
114- options.set_option(" undefined-shift-check" , cmdline.isset(" undefined-shift-check" )); /* NOLINT(whitespace/line_length) */ \
115- options.set_option(" pointer-primitive-check" , cmdline.isset(" pointer-primitive-check" )); /* NOLINT(whitespace/line_length) */ \
116- (void ) 0 ;
117- // clang-format on
97+ #define PARSE_OPTION_OVERRIDE (cmdline, options, option ) \
98+ if (cmdline.isset(option)) \
99+ options.set_option(option, true ); \
100+ if (cmdline.isset(" no-" option)) \
101+ options.set_option(option, false ); \
102+ (void )0
118103
119104// clang-format off
120105#define PARSE_OPTIONS_GOTO_CHECK (cmdline, options ) \
@@ -134,7 +119,13 @@ void goto_check_c(
134119 options.set_option(" assert-to-assume" , cmdline.isset(" assert-to-assume" )); /* NOLINT(whitespace/line_length) */ \
135120 options.set_option(" retain-trivial" , cmdline.isset(" retain-trivial" )); /* NOLINT(whitespace/line_length) */ \
136121 if (cmdline.isset(" error-label" )) \
137- options.set_option(" error-label" , cmdline.get_values(" error-label" )); \
122+ options.set_option(" error-label" , cmdline.get_values(" error-label" )); \
123+ PARSE_OPTION_OVERRIDE (cmdline, options, " bounds-check" ); \
124+ PARSE_OPTION_OVERRIDE (cmdline, options, " pointer-check" ); \
125+ PARSE_OPTION_OVERRIDE (cmdline, options, " div-by-zero-check" ); \
126+ PARSE_OPTION_OVERRIDE (cmdline, options, " signed-overflow-check" ); \
127+ PARSE_OPTION_OVERRIDE (cmdline, options, " undefined-shift-check" ); \
128+ PARSE_OPTION_OVERRIDE (cmdline, options, " pointer-primitive-check" ); \
138129 (void )0
139130// clang-format on
140131
0 commit comments