Skip to content

Commit 9419211

Browse files
author
Thomas Kiley
committed
Expand the error message for function with array but without size parameter
The error was a bit cryptic as to what it means, now tells the user exactly which function has a parameter that has been labelled as an array, but is missing the size parameter. Now produces: Invalid User Input Option: --associated-array-size Reason: could not find parameter to associate the array size of array "arr" (Expected parameter: "siz" on function "test2" in file example.c line 9)
1 parent cf60c2a commit 9419211

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goto-harness/function_call_harness_generator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,11 @@ function_call_harness_generatort::implt::declare_arguments(
508508
associated_array_size_argument == parameter_name_to_argument_name.end())
509509
{
510510
throw invalid_command_line_argument_exceptiont{
511-
"associated array size is not there",
511+
"could not find parameter to associate the array size of array \"" +
512+
id2string(parameter_name) + "\" (Expected parameter: \"" +
513+
id2string(associated_array_size_parameter) + "\" on function \"" +
514+
id2string(function_to_call.display_name()) + "\" in " +
515+
function_to_call.location.as_string() + ")",
512516
"--" FUNCTION_HARNESS_GENERATOR_ASSOCIATED_ARRAY_SIZE_OPT};
513517
}
514518
function_argument_to_associated_array_size.insert(

0 commit comments

Comments
 (0)