Skip to content

Commit 8b69de0

Browse files
committed
Throw exception when using incompatible object factory string handling options
Throw an invalid_command_line_argument_exceptiont when using object factory string handling options that don't both have an effect when used together (rather than printing a warning and ignoring an option).
1 parent 6f06664 commit 8b69de0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
255255
{
256256
if(cmdline.isset("no-refine-strings"))
257257
{
258-
warning() << "--string-printable ignored due to --no-refine-strings"
259-
<< eom;
258+
throw invalid_command_line_argument_exceptiont(
259+
"cannot use --string-printable with --no-refine-strings",
260+
"--string-printable");
260261
}
261262
options.set_option("string-printable", true);
262263
}
@@ -265,8 +266,9 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
265266
{
266267
if(cmdline.isset("no-refine-strings"))
267268
{
268-
warning() << "--string-input-value ignored due to --no-refine-strings"
269-
<< eom;
269+
throw invalid_command_line_argument_exceptiont(
270+
"cannot use --string-input-value with --no-refine-strings",
271+
"--string-input-value");
270272
}
271273
options.set_option(
272274
"string-input-value",
@@ -277,8 +279,9 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
277279
cmdline.isset("no-refine-strings") &&
278280
cmdline.isset("max-nondet-string-length"))
279281
{
280-
warning() << "--max-nondet-string-length ignored due to "
281-
<< "--no-refine-strings" << eom;
282+
throw invalid_command_line_argument_exceptiont(
283+
"cannot use --max-nondet-string-length with --no-refine-strings",
284+
"--max-nondet-string-length");
282285
}
283286

284287
if(cmdline.isset("max-node-refinement"))

0 commit comments

Comments
 (0)