File tree 3 files changed +14
-10
lines changed
regression/ansi-c/human-readable-error-on-wrong-main-signature
3 files changed +14
-10
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 2
2
main.c
3
3
4
4
'main' with signature .* found
5
- ^EXIT=6 $
5
+ ^EXIT=(1|64) $
6
6
^SIGNAL=0$
7
7
--
8
8
Invariant check failed
Original file line number Diff line number Diff line change @@ -478,15 +478,19 @@ bool generate_ansi_c_start_function(
478
478
{
479
479
const namespacet ns{symbol_table};
480
480
const std::string main_signature = type2c (symbol.type , ns);
481
- throw invalid_source_file_exceptiont{
482
- " 'main' with signature '" + main_signature +
483
- " ' found,"
484
- " but expecting one of:\n "
485
- " int main(void)\n "
486
- " int main(int argc, char *argv[])\n "
487
- " int main(int argc, char *argv[], char *envp[])\n "
488
- " If this is a non-standard main entry point please provide a custom\n "
489
- " entry function and point to it via cbmc --function instead" };
481
+ messaget message (message_handler);
482
+ message.error ().source_location = symbol.location ;
483
+ message.error () << " 'main' with signature '" << main_signature
484
+ << " ' found,"
485
+ << " but expecting one of:\n "
486
+ << " int main(void)\n "
487
+ << " int main(int argc, char *argv[])\n "
488
+ << " int main(int argc, char *argv[], char *envp[])\n "
489
+ << " If this is a non-standard main entry point please "
490
+ " provide a custom\n "
491
+ << " entry function and use --function instead"
492
+ << messaget::eom;
493
+ return true ;
490
494
}
491
495
}
492
496
else
You can’t perform that action at this time.
0 commit comments