Commit 2af5e9e2 by Richard Kenner

(main, args case 'D'): Rewrite to avoid uninitialized var.

(main, args case 'A'): Delete unused var P1.
(rescan): Initialize STR.
(do_xifdef, do_endif): Initialize arg to skip_to_end_of_comment.

From-SVN: r6641
parent 79be3418
/* C Compatible Compiler Preprocessor (CCCP)
Copyright (C) 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
Copyright (C) 1986, 87, 89, 92, 93, 1994 Free Software Foundation, Inc.
Written by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
......@@ -1418,23 +1418,17 @@ main (argc, argv)
break;
case 'D':
{
char *p, *p1;
if (argv[i][2] != 0)
p = argv[i] + 2;
pend_defs[i] = argv[i] + 2;
else if (i + 1 == argc)
fatal ("Macro name missing after -D option");
else
p = argv[++i];
pend_defs[i] = p;
}
i++, pend_defs[i] = argv[i];
break;
case 'A':
{
char *p, *p1;
char *p;
if (argv[i][2] != 0)
p = argv[i] + 2;
......@@ -3199,9 +3193,12 @@ hashcollision:
/* Come here to return -- but first give an error message
if there was an unterminated successful conditional. */
ending:
if (if_stack != ip->if_stack) {
char *str;
switch (if_stack->type) {
if (if_stack != ip->if_stack)
{
char *str = "unknown";
switch (if_stack->type)
{
case T_IF:
str = "if";
break;
......@@ -3218,6 +3215,7 @@ hashcollision:
str = "elif";
break;
}
error_with_line (line_for_error (if_stack->lineno),
"unterminated `#%s' conditional", str);
}
......@@ -6651,7 +6649,7 @@ do_xifdef (buf, limit, op, keyword)
;
else if (c == '/' && p != ip->bufp && *p == '*') {
/* Skip this comment. */
int junk;
int junk = 0;
U_CHAR *save_bufp = ip->bufp;
ip->bufp = p + 1;
p = skip_to_end_of_comment (ip, &junk, 1);
......@@ -7046,7 +7044,7 @@ do_endif (buf, limit, op, keyword)
case '/':
if (p != ep && *p == '*') {
/* Skip this comment. */
int junk;
int junk = 0;
U_CHAR *save_bufp = ip->bufp;
ip->bufp = p + 1;
p = skip_to_end_of_comment (ip, &junk, 1);
......
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