aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--libtcc.c5
-rw-r--r--tcc.c1
3 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 426fbb9..21632fc 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,11 @@ endif
endif
endif
+# make clang accept gnuisms in libtcc1.c
+ifeq ($(CC),clang)
+CFLAGS+=-fheinous-gnu-extensions
+endif
+
ifdef CONFIG_WIN64
CONFIG_WIN32=yes
endif
diff --git a/libtcc.c b/libtcc.c
index 6ec7a83..3bcc5d5 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1643,6 +1643,7 @@ enum {
TCC_OPTION_MD,
TCC_OPTION_MF,
TCC_OPTION_x,
+ TCC_OPTION_dumpversion
};
#define TCC_OPTION_HAS_ARG 0x0001
@@ -1693,6 +1694,7 @@ static const TCCOption tcc_options[] = {
{ "MD", TCC_OPTION_MD, 0},
{ "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
{ "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
+ { "dumpversion", TCC_OPTION_dumpversion, 0},
{ NULL, 0, 0 },
};
@@ -1870,6 +1872,9 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
case TCC_OPTION_MF:
s->deps_outfile = tcc_strdup(optarg);
break;
+ case TCC_OPTION_dumpversion:
+ printf ("%s\n", TCC_VERSION);
+ exit(0);
case TCC_OPTION_O:
case TCC_OPTION_pedantic:
case TCC_OPTION_pipe:
diff --git a/tcc.c b/tcc.c
index f4ff3f8..7c1b133 100644
--- a/tcc.c
+++ b/tcc.c
@@ -38,6 +38,7 @@ static void help(void)
" -w disable all warnings\n"
" -v show version\n"
" -vv show included files (as sole argument: show search paths)\n"
+ " -dumpversion\n"
" -bench show compilation statistics\n"
"Preprocessor options:\n"
" -E preprocess only\n"