From b285fc50f37e7b1373b224b0de983793117ae015 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 27 Jun 2016 18:06:32 +0200 Subject: [PATCH] Add --param, reject -mARG if ARG not 32 or 64 --- libtcc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtcc.c b/libtcc.c index 3d4acff2..806124a5 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1523,6 +1523,7 @@ enum { TCC_OPTION_nostdlib, TCC_OPTION_print_search_dirs, TCC_OPTION_rdynamic, + TCC_OPTION_param, TCC_OPTION_pedantic, TCC_OPTION_pthread, TCC_OPTION_run, @@ -1568,6 +1569,7 @@ static const TCCOption tcc_options[] = { { "shared", TCC_OPTION_shared, 0 }, { "soname", TCC_OPTION_soname, TCC_OPTION_HAS_ARG }, { "o", TCC_OPTION_o, TCC_OPTION_HAS_ARG }, + { "-param", TCC_OPTION_param, TCC_OPTION_HAS_ARG }, { "pedantic", TCC_OPTION_pedantic, 0}, { "pthread", TCC_OPTION_pthread, 0}, { "run", TCC_OPTION_run, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, @@ -1770,6 +1772,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) s->soname = tcc_strdup(optarg); break; case TCC_OPTION_m: + if (strcmp(optarg, "32") && strcmp(optarg, "64")) + goto unsupported_option; s->option_m = tcc_strdup(optarg); break; case TCC_OPTION_o: