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 @@ -480,15 +480,19 @@ bool generate_ansi_c_start_function(
480
480
{
481
481
const namespacet ns{symbol_table};
482
482
const std::string main_signature = type2c (symbol.type , ns);
483
- throw invalid_source_file_exceptiont{
484
- " 'main' with signature '" + main_signature +
485
- " ' found,"
486
- " but expecting one of:\n "
487
- " int main(void)\n "
488
- " int main(int argc, char *argv[])\n "
489
- " int main(int argc, char *argv[], char *envp[])\n "
490
- " If this is a non-standard main entry point please provide a custom\n "
491
- " entry function and point to it via cbmc --function instead" };
483
+ messaget message (message_handler);
484
+ message.error ().source_location = symbol.location ;
485
+ message.error () << " 'main' with signature '" << main_signature
486
+ << " ' found,"
487
+ << " but expecting one of:\n "
488
+ << " int main(void)\n "
489
+ << " int main(int argc, char *argv[])\n "
490
+ << " int main(int argc, char *argv[], char *envp[])\n "
491
+ << " If this is a non-standard main entry point please "
492
+ " provide a custom\n "
493
+ << " entry function and use --function instead"
494
+ << messaget::eom;
495
+ return true ;
492
496
}
493
497
}
494
498
else
You can’t perform that action at this time.
0 commit comments