diff options
| author | seyko <seyko2@gmail.com> | 2015-03-03 14:25:57 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-03-03 14:25:57 +0300 |
| commit | b7b9f9f51170bd1616ee56acfef9c6bf20b9cf3f (patch) | |
| tree | b31eb010c27630fdc5eeb8cd9b8c9c1548b3153f /libtcc.c | |
| parent | 50cdccf3efaa13dd11d1533b73fb34e0429d5cd6 (diff) | |
| download | tinycc-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 */ |
