Unified · Split
| @@ -1608,7 +1608,7 @@ static int args_parser_make_argv(const char *r, int *argc, char ***argv) · 1607 unmodified lines | ||
| 1608 | 1608 | CString str; |
| 1609 | 1609 | for(;;) { |
| 1610 | 1610 | while (c = (unsigned char)*r, c && c <= ' ') |
| 1611 | − ++r; | |
| 1611 | + ++r; | |
| 1612 | 1612 | if (c == 0) |
| 1613 | 1613 | break; |
| 1614 | 1614 | q = 0; |
| @@ -1681,7 +1681,7 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *pargc, char ***pargv, int optind) · 66 unmodified lines | ||
| 1681 | 1681 | r = argv[optind]; |
| 1682 | 1682 | if (r[0] == '@' && r[1] != '\0') { |
| 1683 | 1683 | args_parser_listfile(s, r + 1, optind, &argc, &argv); |
| 1684 | − continue; | |
| 1684 | + continue; | |
| 1685 | 1685 | } |
| 1686 | 1686 | optind++; |
| 1687 | 1687 | if (tool) { |
| @@ -1792,15 +1792,42 @@ reparse: · 104 unmodified lines | ||
| 1792 | 1792 | break; |
| 1793 | 1793 | case TCC_OPTION_std: |
| 1794 | 1794 | if (*optarg == '=') { |
| 1795 | − ++optarg; | |
| 1796 | − if (strcmp(optarg, "c11") == 0) { | |
| 1795 | + if (strcmp(optarg, "=c11") == 0) { | |
| 1797 | 1796 | tcc_undefine_symbol(s, "__STDC_VERSION__"); |
| 1798 | 1797 | tcc_define_symbol(s, "__STDC_VERSION__", "201112L"); |
| 1798 | + /* | |
| 1799 | + * The integer constant 1, intended to indicate | |
| 1800 | + * that the implementation does not support atomic | |
| 1801 | + * types (including the _Atomic type qualifier) and | |
| 1802 | + * the <stdatomic.h> header. | |
| 1803 | + */ | |
| 1804 | + tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1"); | |
| 1805 | + /* | |
| 1806 | + * The integer constant 1, intended to indicate | |
| 1807 | + * that the implementation does not support complex | |
| 1808 | + * types or the <complex.h> header. | |
| 1809 | + */ | |
| 1810 | + tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1"); | |
| 1811 | + /* | |
| 1812 | + * The integer constant 1, intended to indicate | |
| 1813 | + * that the implementation does not support the | |
| 1814 | + * <threads.h> header. | |
| 1815 | + */ | |
| 1816 | + tcc_define_symbol(s, "__STDC_NO_THREADS__", "1"); | |
| 1817 | + /* | |
| 1818 | + * __STDC_NO_VLA__, tcc supports VLA. | |
| 1819 | + * The integer constant 1, intended to indicate | |
| 1820 | + * that the implementation does not support | |
| 1821 | + * variable length arrays or variably modified | |
| 1822 | + * types. | |
| 1823 | + */ | |
| 1799 | 1824 | s->cversion = 201112; |
| 1800 | 1825 | } |
| 1801 | 1826 | } |
| 1802 | − /* silently ignore other values, a current purpose: | |
| 1803 | − allow to use a tcc as a reference compiler for "make test" */ | |
| 1827 | + /* | |
| 1828 | + * silently ignore other values, a current purpose: | |
| 1829 | + * allow to use a tcc as a reference compiler for "make test" | |
| 1830 | + */ | |
| 1804 | 1831 | break; |
| 1805 | 1832 | case TCC_OPTION_shared: |
| 1806 | 1833 | x = TCC_OUTPUT_DLL; |
| @@ -1823,10 +1850,10 @@ reparse: · 16 unmodified lines | ||
| 1823 | 1850 | case TCC_OPTION_isystem: |
| 1824 | 1851 | tcc_add_sysinclude_path(s, optarg); |
| 1825 | 1852 | break; |
| 1826 | − case TCC_OPTION_include: | |
| 1827 | − dynarray_add(&s->cmd_include_files, | |
| 1828 | − &s->nb_cmd_include_files, tcc_strdup(optarg)); | |
| 1829 | − break; | |
| 1853 | + case TCC_OPTION_include: | |
| 1854 | + dynarray_add(&s->cmd_include_files, | |
| 1855 | + &s->nb_cmd_include_files, tcc_strdup(optarg)); | |
| 1856 | + break; | |
| 1830 | 1857 | case TCC_OPTION_nostdinc: |
| 1831 | 1858 | s->nostdinc = 1; |
| 1832 | 1859 | break; |
| @@ -1886,9 +1913,9 @@ reparse: · 53 unmodified lines | ||
| 1886 | 1913 | if (tcc_set_linker(s, linker_arg.data)) |
| 1887 | 1914 | cstr_free(&linker_arg); |
| 1888 | 1915 | break; |
| 1889 | − case TCC_OPTION_Wp: | |
| 1890 | − r = optarg; | |
| 1891 | − goto reparse; | |
| 1916 | + case TCC_OPTION_Wp: | |
| 1917 | + r = optarg; | |
| 1918 | + goto reparse; | |
| 1892 | 1919 | case TCC_OPTION_E: |
| 1893 | 1920 | x = TCC_OUTPUT_PREPROCESS; |
| 1894 | 1921 | goto set_output_type; |