Commit 49df5f37 by Richard Stallman

(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
parent 7a0347ff
...@@ -1447,6 +1447,14 @@ main (argc, argv) ...@@ -1447,6 +1447,14 @@ main (argc, argv)
/* Now handle the command line options. */ /* 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. */ /* Do assertions specified with -A. */
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
if (pend_assertions[i]) if (pend_assertions[i])
...@@ -1460,14 +1468,6 @@ main (argc, argv) ...@@ -1460,14 +1468,6 @@ main (argc, argv)
make_definition (pend_defs[i], &outbuf); 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; done_initializing = 1;
{ /* read the appropriate environment variable and if it exists { /* read the appropriate environment variable and if it exists
...@@ -1697,7 +1697,11 @@ main (argc, argv) ...@@ -1697,7 +1697,11 @@ main (argc, argv)
else else
deps_output (p, 0); deps_output (p, 0);
/* Supply our own suffix. */ /* Supply our own suffix. */
#ifndef VMS
deps_output (".o : ", 0); deps_output (".o : ", 0);
#else
deps_output (".obj : ", 0);
#endif
deps_output (in_fname, 0); deps_output (in_fname, 0);
deps_output (" ", 0); deps_output (" ", 0);
} }
...@@ -2270,6 +2274,8 @@ do { ip = &instack[indepth]; \ ...@@ -2270,6 +2274,8 @@ do { ip = &instack[indepth]; \
and backslash-newlines, and see if we reach this #. and backslash-newlines, and see if we reach this #.
If not, this # is not special. */ If not, this # is not special. */
bp = beg_of_line; bp = beg_of_line;
/* If -traditional, require # to be at beginning of line. */
if (!traditional)
while (1) { while (1) {
if (is_hor_space[*bp]) if (is_hor_space[*bp])
bp++; bp++;
...@@ -3735,7 +3741,6 @@ get_filename: ...@@ -3735,7 +3741,6 @@ get_filename:
} }
break; break;
} }
goto fail;
case '<': case '<':
fend = fbeg; fend = fbeg;
...@@ -6082,22 +6087,16 @@ do_xifdef (buf, limit, op, keyword) ...@@ -6082,22 +6087,16 @@ do_xifdef (buf, limit, op, keyword)
U_CHAR *p = ip->buf; U_CHAR *p = ip->buf;
while (p != directive_start) { while (p != directive_start) {
char c = *p++; char c = *p++;
switch (c) { if (is_space[c])
case ' ': ;
case '\t': else if (c == '/' && p != ip->bufp && *p == '*') {
case '\n':
break;
case '/':
if (p != ip->bufp && *p == '*') {
/* Skip this comment. */ /* Skip this comment. */
int junk; int junk;
U_CHAR *save_bufp = ip->bufp; U_CHAR *save_bufp = ip->bufp;
ip->bufp = p + 1; ip->bufp = p + 1;
p = skip_to_end_of_comment (ip, &junk, 1); p = skip_to_end_of_comment (ip, &junk, 1);
ip->bufp = save_bufp; ip->bufp = save_bufp;
} } else {
break;
default:
goto fail; goto fail;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment