| @@ -906,7 +906,7 @@ LIBTCCAPI TCCState *tcc_new(void) · 905 unmodified lines |
| 906 | 906 | #else |
| 907 | 907 | tcc_set_lib_path(s, CONFIG_TCCDIR); |
| 908 | 908 | #endif |
| 909 | | − s->output_type = TCC_OUTPUT_MEMORY; |
| 909 | + s->output_type = 0; |
| 910 | 910 | preprocess_new(); |
| 911 | 911 | s->include_stack_ptr = s->include_stack; |
| 912 | 912 | |
| @@ -1831,6 +1831,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 918 unmodified lines |
| 1831 | 1831 | s->do_debug = 1; |
| 1832 | 1832 | break; |
| 1833 | 1833 | case TCC_OPTION_c: |
| 1834 | + if (s->output_type) |
| 1835 | + tcc_warning("-c: some compiler action already specified (%d)", s->output_type); |
| 1834 | 1836 | s->output_type = TCC_OUTPUT_OBJ; |
| 1835 | 1837 | break; |
| 1836 | 1838 | #ifdef TCC_TARGET_ARM |
| @@ -1849,6 +1851,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 12 unmodified lines |
| 1849 | 1851 | s->static_link = 1; |
| 1850 | 1852 | break; |
| 1851 | 1853 | case TCC_OPTION_shared: |
| 1854 | + if (s->output_type) |
| 1855 | + tcc_warning("-shared: some compiler action already specified (%d)", s->output_type); |
| 1852 | 1856 | s->output_type = TCC_OUTPUT_DLL; |
| 1853 | 1857 | break; |
| 1854 | 1858 | case TCC_OPTION_soname: |
| @@ -1862,6 +1866,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 7 unmodified lines |
| 1862 | 1866 | break; |
| 1863 | 1867 | case TCC_OPTION_r: |
| 1864 | 1868 | /* generate a .o merging several output files */ |
| 1869 | + if (s->output_type) |
| 1870 | + tcc_warning("-r: some compiler action already specified (%d)", s->output_type); |
| 1865 | 1871 | s->option_r = 1; |
| 1866 | 1872 | s->output_type = TCC_OUTPUT_OBJ; |
| 1867 | 1873 | break; |
| @@ -1878,6 +1884,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 10 unmodified lines |
| 1878 | 1884 | s->print_search_dirs = 1; |
| 1879 | 1885 | break; |
| 1880 | 1886 | case TCC_OPTION_run: |
| 1887 | + if (s->output_type) |
| 1888 | + tcc_warning("-run: some compiler action already specified (%d)", s->output_type); |
| 1881 | 1889 | s->output_type = TCC_OUTPUT_MEMORY; |
| 1882 | 1890 | tcc_set_options(s, optarg); |
| 1883 | 1891 | run = 1; |
| @@ -1907,6 +1915,8 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 23 unmodified lines |
| 1907 | 1915 | cstr_ccat(&linker_arg, '\0'); |
| 1908 | 1916 | break; |
| 1909 | 1917 | case TCC_OPTION_E: |
| 1918 | + if (s->output_type) |
| 1919 | + tcc_warning("-E: some compiler action already specified (%d)", s->output_type); |
| 1910 | 1920 | s->output_type = TCC_OUTPUT_PREPROCESS; |
| 1911 | 1921 | break; |
| 1912 | 1922 | case TCC_OPTION_MD: |