diff options
Diffstat (limited to 'src/tools/lcc')
-rw-r--r-- | src/tools/lcc/cpp/cpp.c | 7 | ||||
-rw-r--r-- | src/tools/lcc/cpp/cpp.h | 2 | ||||
-rw-r--r-- | src/tools/lcc/cpp/getopt.c | 2 | ||||
-rw-r--r-- | src/tools/lcc/cpp/nlist.c | 2 | ||||
-rw-r--r-- | src/tools/lcc/cpp/unix.c | 4 |
5 files changed, 11 insertions, 6 deletions
diff --git a/src/tools/lcc/cpp/cpp.c b/src/tools/lcc/cpp/cpp.c index 6739e4d9..1fcffbc5 100644 --- a/src/tools/lcc/cpp/cpp.c +++ b/src/tools/lcc/cpp/cpp.c @@ -204,9 +204,14 @@ control(Tokenrow *trp) error(WARNING, "Syntax error in #endif"); break; + case KWARNING: + trp->tp = tp+1; + error(WARNING, "#warning directive: %r", trp); + break; + case KERROR: trp->tp = tp+1; - error(WARNING, "#error directive: %r", trp); + error(ERROR, "#error directive: %r", trp); break; case KLINE: diff --git a/src/tools/lcc/cpp/cpp.h b/src/tools/lcc/cpp/cpp.h index ae855c91..87871d9d 100644 --- a/src/tools/lcc/cpp/cpp.h +++ b/src/tools/lcc/cpp/cpp.h @@ -24,7 +24,7 @@ enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP, DSHARP1, NAME1, DEFINED, UMINUS }; enum kwtype { KIF, KIFDEF, KIFNDEF, KELIF, KELSE, KENDIF, KINCLUDE, KDEFINE, - KUNDEF, KLINE, KERROR, KPRAGMA, KDEFINED, + KUNDEF, KLINE, KWARNING, KERROR, KPRAGMA, KDEFINED, KLINENO, KFILE, KDATE, KTIME, KSTDC, KEVAL }; #define ISDEFINED 01 /* has #defined value */ diff --git a/src/tools/lcc/cpp/getopt.c b/src/tools/lcc/cpp/getopt.c index abcb35f8..c4d1af7b 100644 --- a/src/tools/lcc/cpp/getopt.c +++ b/src/tools/lcc/cpp/getopt.c @@ -8,7 +8,7 @@ int optopt; char *optarg; int -getopt (int argc, char *const argv[], const char *opts) +lcc_getopt (int argc, char *const argv[], const char *opts) { static int sp = 1; int c; diff --git a/src/tools/lcc/cpp/nlist.c b/src/tools/lcc/cpp/nlist.c index d857dfa5..d3a83573 100644 --- a/src/tools/lcc/cpp/nlist.c +++ b/src/tools/lcc/cpp/nlist.c @@ -3,7 +3,6 @@ #include <string.h> #include "cpp.h" -extern int getopt(int, char *const *, const char *); extern char *optarg; extern int optind; extern int verbose; @@ -30,6 +29,7 @@ struct kwtab { {"define", KDEFINE, ISKW}, {"undef", KUNDEF, ISKW}, {"line", KLINE, ISKW}, + {"warning", KWARNING, ISKW}, {"error", KERROR, ISKW}, {"pragma", KPRAGMA, ISKW}, {"eval", KEVAL, ISKW}, diff --git a/src/tools/lcc/cpp/unix.c b/src/tools/lcc/cpp/unix.c index 397b1b4c..17986d84 100644 --- a/src/tools/lcc/cpp/unix.c +++ b/src/tools/lcc/cpp/unix.c @@ -4,7 +4,7 @@ #include <string.h> #include "cpp.h" -extern int getopt(int, char *const *, const char *); +extern int lcc_getopt(int, char *const *, const char *); extern char *optarg, rcsid[]; extern int optind; int verbose; @@ -23,7 +23,7 @@ setup(int argc, char **argv) int numIncludeDirs = 0; setup_kwtab(); - while ((c = getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1) + while ((c = lcc_getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1) switch (c) { case 'N': for (i=0; i<NINCLUDE; i++) |