aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-03-03 14:25:57 +0300
committerseyko <seyko2@gmail.com>2015-03-03 14:25:57 +0300
commitb7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f (patch)
treeb31eb010c27630fdc5eeb8cd9b8c9c1548b3153f /libtcc.c
parent50cdccf3efaa13dd11d1533b73fb34e0429d5cd6 (diff)
downloadtinycc-b7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f.tar.gz
tinycc-b7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f.tar.bz2
A gcc preprocessor option -dD added
With this option on a defines are included into the output (inside comments). This will allow to debug a problems like: In file included from math.c:8: In file included from /usr/include/math.h:43: /usr/include/bits/nan.h:52: warning: NAN redefined
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libtcc.c b/libtcc.c
index 3581ffb..72524eb 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1656,6 +1656,7 @@ enum {
TCC_OPTION_b,
TCC_OPTION_g,
TCC_OPTION_c,
+ TCC_OPTION_d,
TCC_OPTION_float_abi,
TCC_OPTION_static,
TCC_OPTION_shared,
@@ -1709,6 +1710,7 @@ static const TCCOption tcc_options[] = {
#endif
{ "g", TCC_OPTION_g, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
{ "c", TCC_OPTION_c, 0 },
+ { "d", TCC_OPTION_d, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP },
#ifdef TCC_TARGET_ARM
{ "mfloat-abi", TCC_OPTION_float_abi, TCC_OPTION_HAS_ARG },
#endif
@@ -1848,6 +1850,14 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
tcc_warning("-c: some compiler action already specified (%d)", s->output_type);
s->output_type = TCC_OUTPUT_OBJ;
break;
+ case TCC_OPTION_d:
+ if (*optarg != 'D') {
+ if (s->warn_unsupported)
+ goto unsupported_option;
+ tcc_error("invalid option -- '%s'", r);
+ }
+ s->dflag = 1;
+ break;
#ifdef TCC_TARGET_ARM
case TCC_OPTION_float_abi:
/* tcc doesn't support soft float yet */