version 1.25, 2015/12/04 21:23:19 |
version 1.26, 2015/12/10 19:10:46 |
|
|
cp += 2; |
cp += 2; |
} else if (strncmp(cp, "\n", 1) == 0) { |
} else if (strncmp(cp, "\n", 1) == 0) { |
if (incomment == CHAR_LITERAL) |
if (incomment == CHAR_LITERAL) |
error("unterminated char literal"); |
error("Unterminated char literal"); |
else |
else |
error("unterminated string literal"); |
error("Unterminated string literal"); |
} else |
} else |
cp += 1; |
cp += 1; |
continue; |
continue; |
|
|
if ((cp = matchsym("define", kw)) != NULL) { |
if ((cp = matchsym("define", kw)) != NULL) { |
sym = getsym(&cp); |
sym = getsym(&cp); |
if (sym == NULL) |
if (sym == NULL) |
error("missing macro name in #define"); |
error("Missing macro name in #define"); |
if (*cp == '(') { |
if (*cp == '(') { |
val = "1"; |
val = "1"; |
} else { |
} else { |
|
|
} else if ((cp = matchsym("undef", kw)) != NULL) { |
} else if ((cp = matchsym("undef", kw)) != NULL) { |
sym = getsym(&cp); |
sym = getsym(&cp); |
if (sym == NULL) |
if (sym == NULL) |
error("missing macro name in #undef"); |
error("Missing macro name in #undef"); |
cp = skipcomment(cp); |
cp = skipcomment(cp); |
debug("#undef"); |
debug("#undef"); |
addsym2(false, sym, NULL); |
addsym2(false, sym, NULL); |
} else { |
} else { |
error("unrecognized preprocessor directive"); |
error("Unrecognized preprocessor directive"); |
} |
} |
skipline(cp); |
skipline(cp); |
done: |
done: |
|
|
warnx("%s: %d: %s (#if line %d depth %d)", |
warnx("%s: %d: %s (#if line %d depth %d)", |
filename, linenum, msg, stifline[depth], depth); |
filename, linenum, msg, stifline[depth], depth); |
closeio(); |
closeio(); |
errx(2, "output may be truncated"); |
errx(2, "Output may be truncated"); |
} |
} |
|
|
static FILE * |
static FILE * |