this is gcc behaviour
Unified · Split
| @@ -2048,6 +2048,15 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 2047 unmodified lines | |||
| 2048 | tcc_warning("unsupported language '%s'", optarg); | 2048 | tcc_warning("unsupported language '%s'", optarg); |
| 2049 | break; | 2049 | break; |
| 2050 | case TCC_OPTION_O: | 2050 | case TCC_OPTION_O: |
| 2051 | if (1) { | ||
| 2052 | int opt = atoi(optarg); | ||
| 2053 | char *sym = "__OPTIMIZE__"; | ||
| 2054 | if (opt) | ||
| 2055 | tcc_define_symbol(s, sym, 0); | ||
| 2056 | else | ||
| 2057 | tcc_undefine_symbol(s, sym); | ||
| 2058 | } | ||
| 2059 | break; | ||
| 2051 | case TCC_OPTION_pedantic: | 2060 | case TCC_OPTION_pedantic: |
| 2052 | case TCC_OPTION_pipe: | 2061 | case TCC_OPTION_pipe: |
| 2053 | /* ignored */ | 2062 | /* ignored */ |