diff options
author | Richard Stallman <rms@gnu.org> | 1992-10-06 00:24:40 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-10-06 00:24:40 +0000 |
commit | 49df5f372b29df7941da5ea40ff04c2b9f9581ef (patch) | |
tree | 3e785ec32cf448491cec9cbd40eb7bf53e5e54e7 /gcc | |
parent | 7a0347fff32015826a7da2704442a80979f43e10 (diff) | |
download | gcc-49df5f372b29df7941da5ea40ff04c2b9f9581ef.zip gcc-49df5f372b29df7941da5ea40ff04c2b9f9581ef.tar.gz gcc-49df5f372b29df7941da5ea40ff04c2b9f9581ef.tar.bz2 |
(main): Handle -U before -D (and -A).
(rescan): If traditional, recognize # only at bol.
(main) [VMS]: Use .obj, not .o, in dependencies output.
(do_include): Delete unreachable goto after '"' case.
(do_xifdef): Skip all kinds of whitespace, in bof test.
From-SVN: r2333
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cccp.c | 79 |
1 files changed, 39 insertions, 40 deletions
@@ -1447,6 +1447,14 @@ main (argc, argv) /* Now handle the command line options. */ + /* Do undefines specified with -U. */ + for (i = 1; i < argc; i++) + if (pend_undefs[i]) { + if (debug_output) + output_line_command (fp, &outbuf, 0, same_file); + make_undef (pend_undefs[i], &outbuf); + } + /* Do assertions specified with -A. */ for (i = 1; i < argc; i++) if (pend_assertions[i]) @@ -1460,14 +1468,6 @@ main (argc, argv) make_definition (pend_defs[i], &outbuf); } - /* Do undefines specified with -U. */ - for (i = 1; i < argc; i++) - if (pend_undefs[i]) { - if (debug_output) - output_line_command (fp, &outbuf, 0, same_file); - make_undef (pend_undefs[i], &outbuf); - } - done_initializing = 1; { /* read the appropriate environment variable and if it exists @@ -1697,7 +1697,11 @@ main (argc, argv) else deps_output (p, 0); /* Supply our own suffix. */ +#ifndef VMS deps_output (".o : ", 0); +#else + deps_output (".obj : ", 0); +#endif deps_output (in_fname, 0); deps_output (" ", 0); } @@ -2270,23 +2274,25 @@ do { ip = &instack[indepth]; \ and backslash-newlines, and see if we reach this #. If not, this # is not special. */ bp = beg_of_line; - while (1) { - if (is_hor_space[*bp]) - bp++; - else if (*bp == '\\' && bp[1] == '\n') - bp += 2; - else if (*bp == '/' && bp[1] == '*') { - bp += 2; - while (!(*bp == '*' && bp[1] == '/')) + /* If -traditional, require # to be at beginning of line. */ + if (!traditional) + while (1) { + if (is_hor_space[*bp]) bp++; - bp += 2; - } - else if ((cplusplus || objc) && *bp == '/' && bp[1] == '/') { - bp += 2; - while (*bp++ != '\n') ; + else if (*bp == '\\' && bp[1] == '\n') + bp += 2; + else if (*bp == '/' && bp[1] == '*') { + bp += 2; + while (!(*bp == '*' && bp[1] == '/')) + bp++; + bp += 2; + } + else if ((cplusplus || objc) && *bp == '/' && bp[1] == '/') { + bp += 2; + while (*bp++ != '\n') ; + } + else break; } - else break; - } if (bp + 1 != ibp) goto randomchar; } @@ -3735,7 +3741,6 @@ get_filename: } break; } - goto fail; case '<': fend = fbeg; @@ -6082,22 +6087,16 @@ do_xifdef (buf, limit, op, keyword) U_CHAR *p = ip->buf; while (p != directive_start) { char c = *p++; - switch (c) { - case ' ': - case '\t': - case '\n': - break; - case '/': - if (p != ip->bufp && *p == '*') { - /* Skip this comment. */ - int junk; - U_CHAR *save_bufp = ip->bufp; - ip->bufp = p + 1; - p = skip_to_end_of_comment (ip, &junk, 1); - ip->bufp = save_bufp; - } - break; - default: + if (is_space[c]) + ; + else if (c == '/' && p != ip->bufp && *p == '*') { + /* Skip this comment. */ + int junk; + U_CHAR *save_bufp = ip->bufp; + ip->bufp = p + 1; + p = skip_to_end_of_comment (ip, &junk, 1); + ip->bufp = save_bufp; + } else { goto fail; } } |