Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O1 is the default in the help message #464

Merged
merged 8 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static const char help_fmt[] =
"\n"
"Options:\n"
" -o OUTFILE output an executable file, don't run the code\n"
" -O0/-O1/-O2/-O3 set optimization level (0 = default, 3 = runs fastest)\n"
" -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest)\n"
" -v / --verbose display some progress information\n"
" -vv display a lot of information about all compilation steps\n"
" --valgrind use valgrind when running the code\n"
Expand All @@ -55,9 +55,8 @@ void parse_arguments(int argc, char **argv)
{
memset(&command_line_args, 0, sizeof command_line_args);
command_line_args.argv0 = argv[0];
command_line_args.optlevel = 1; /* Set default optimize to O1
User sets optimize will overwrite the default flag
*/
/* Set default optimize to O1, user sets optimize will overwrite the default flag*/
command_line_args.optlevel = 1;

if (argc == 2 && !strcmp(argv[1], "--help")) {
// Print help.
Expand Down
2 changes: 1 addition & 1 deletion tests/should_succeed/compiler_cli.jou
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main() -> int:
# Output:
# Output: Options:
# Output: -o OUTFILE output an executable file, don't run the code
# Output: -O0/-O1/-O2/-O3 set optimization level (0 = default, 3 = runs fastest)
# Output: -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest)
# Output: -v / --verbose display some progress information
# Output: -vv display a lot of information about all compilation steps
# Output: --valgrind use valgrind when running the code
Expand Down