Skip to content

Commit

Permalink
recognize -std=gnu11 and treat it the same as -std=c11
Browse files Browse the repository at this point in the history
  • Loading branch information
pskocik committed Oct 9, 2024
1 parent 3110f69 commit b668b72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libtcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *pargc, char ***pargv, int optind)
s->static_link = 1;
break;
case TCC_OPTION_std:
if (strcmp(optarg, "=c11") == 0)
if (strcmp(optarg, "=c11") == 0 || strcmp(optarg, "=gnu11") == 0)
s->cversion = 201112;
break;
case TCC_OPTION_shared:
Expand Down
4 changes: 2 additions & 2 deletions tcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ static const char help[] =
" -o outfile set output filename\n"
" -run run compiled source\n"
" -fflag set or reset (with 'no-' prefix) 'flag' (see tcc -hh)\n"
" -std=c99 Conform to the ISO 1999 C standard (default).\n"
" -std=c11 Conform to the ISO 2011 C standard.\n"
" -std=(c99|gnu99) Conform to the ISO 1999 C standard (default).\n"
" -std=(c11|gnu11) Conform to the ISO 2011 C standard.\n"
" -Wwarning set or reset (with 'no-' prefix) 'warning' (see tcc -hh)\n"
" -w disable all warnings\n"
" -v --version show version\n"
Expand Down

0 comments on commit b668b72

Please sign in to comment.