Skip to content

Commit b668b72

Browse files
committed
recognize -std=gnu11 and treat it the same as -std=c11
1 parent 3110f69 commit b668b72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libtcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *pargc, char ***pargv, int optind)
19771977
s->static_link = 1;
19781978
break;
19791979
case TCC_OPTION_std:
1980-
if (strcmp(optarg, "=c11") == 0)
1980+
if (strcmp(optarg, "=c11") == 0 || strcmp(optarg, "=gnu11") == 0)
19811981
s->cversion = 201112;
19821982
break;
19831983
case TCC_OPTION_shared:

tcc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static const char help[] =
3333
" -o outfile set output filename\n"
3434
" -run run compiled source\n"
3535
" -fflag set or reset (with 'no-' prefix) 'flag' (see tcc -hh)\n"
36-
" -std=c99 Conform to the ISO 1999 C standard (default).\n"
37-
" -std=c11 Conform to the ISO 2011 C standard.\n"
36+
" -std=(c99|gnu99) Conform to the ISO 1999 C standard (default).\n"
37+
" -std=(c11|gnu11) Conform to the ISO 2011 C standard.\n"
3838
" -Wwarning set or reset (with 'no-' prefix) 'warning' (see tcc -hh)\n"
3939
" -w disable all warnings\n"
4040
" -v --version show version\n"

0 commit comments

Comments
 (0)