summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-06-18 22:47:15 -0700
committerOri Bernstein <ori@eigenstate.org>2019-06-18 22:47:15 -0700
commit94fb8869dfba9e09afa9f64a37302dc444393766 (patch)
treee371cdf1ec1f66fc71ac66f36185169e6528b7ca
parentff344562dbefe0e53adc900b6e7cd962ae555e94 (diff)
downloadplan9front-94fb8869dfba9e09afa9f64a37302dc444393766.tar.xz
Always turn on the -+ flag in cpp
C99 comments have been the default in compilers for something like 20 years now. This means we don't need to remember to turn it on when porting software, and gets rid of cryptic errors about unterminated character constants when someone writes something like: // Didn't need to... We still accept the flag to avoid breaking mkfiles, but we do nothing with it. This also removes the documentation, since the option does nothing now.
-rw-r--r--sys/man/1/cpp3
-rw-r--r--sys/man/1/pcc5
-rw-r--r--sys/src/cmd/cpp/cpp.c1
-rw-r--r--sys/src/cmd/cpp/cpp.h1
-rw-r--r--sys/src/cmd/cpp/lex.c8
-rw-r--r--sys/src/cmd/cpp/nlist.c3
-rw-r--r--sys/src/cmd/pcc.c2
7 files changed, 2 insertions, 21 deletions
diff --git a/sys/man/1/cpp b/sys/man/1/cpp
index 3fc931585..14756c91a 100644
--- a/sys/man/1/cpp
+++ b/sys/man/1/cpp
@@ -67,9 +67,6 @@ Do not insert
.RB `` #line ''
directives into the output.
.TP
-.B -+
-Understand C++ comments.
-.TP
.B -.
Inhibit include search in the source's directory.
.TP
diff --git a/sys/man/1/pcc b/sys/man/1/pcc
index fd7acd916..97f1d16be 100644
--- a/sys/man/1/pcc
+++ b/sys/man/1/pcc
@@ -25,11 +25,6 @@ The object files are then loaded using one of the loaders described in
.IR 2l (1).
The options are:
.TP \w'\fL-D\ \fIname=def\ 'u
-.B "-+
-Accept C++
-.B //
-comments.
-.TP
.BI -o " out"
Place loader output in file
.I out
diff --git a/sys/src/cmd/cpp/cpp.c b/sys/src/cmd/cpp/cpp.c
index 49027b34d..c7b6146bb 100644
--- a/sys/src/cmd/cpp/cpp.c
+++ b/sys/src/cmd/cpp/cpp.c
@@ -28,7 +28,6 @@ main(int argc, char **argv)
maketokenrow(3, &tr);
expandlex();
setup(argc, argv);
- fixlex();
iniths();
genline();
process(&tr);
diff --git a/sys/src/cmd/cpp/cpp.h b/sys/src/cmd/cpp/cpp.h
index 2f70ffcfe..b1661ec38 100644
--- a/sys/src/cmd/cpp/cpp.h
+++ b/sys/src/cmd/cpp/cpp.h
@@ -86,7 +86,6 @@ extern unsigned long namebit[077+1];
enum errtype { WARNING, ERROR, FATAL };
void expandlex(void);
-void fixlex(void);
void setup(int, char **);
#define gettokens cpp_gettokens
int gettokens(Tokenrow *, int);
diff --git a/sys/src/cmd/cpp/lex.c b/sys/src/cmd/cpp/lex.c
index 29b27aa26..b63024fb6 100644
--- a/sys/src/cmd/cpp/lex.c
+++ b/sys/src/cmd/cpp/lex.c
@@ -285,14 +285,6 @@ expandlex(void)
}
}
-void
-fixlex(void)
-{
- /* do C++ comments? */
- if (Cplusplus==0)
- bigfsm['/'][COM1] = bigfsm['x'][COM1];
-}
-
/*
* fill in a row of tokens from input, terminated by NL or END
* First token is put at trp->lp.
diff --git a/sys/src/cmd/cpp/nlist.c b/sys/src/cmd/cpp/nlist.c
index e0d771fa6..b0a4e31a7 100644
--- a/sys/src/cmd/cpp/nlist.c
+++ b/sys/src/cmd/cpp/nlist.c
@@ -8,7 +8,6 @@ extern char *optarg;
extern int optind;
int verbose;
int Mflag;
-int Cplusplus;
int nolineinfo;
Nlist *kwdefined;
char wd[128];
@@ -142,7 +141,7 @@ setup(int argc, char **argv)
verbose++;
break;
case '+':
- Cplusplus++;
+ /* Ignored for compatibility */
break;
case 'i':
debuginclude++;
diff --git a/sys/src/cmd/pcc.c b/sys/src/cmd/pcc.c
index 6c733ed12..35663edb3 100644
--- a/sys/src/cmd/pcc.c
+++ b/sys/src/cmd/pcc.c
@@ -65,7 +65,7 @@ main(int argc, char *argv[])
while(argc > 0) {
ARGBEGIN {
case '+':
- append(&cpp, smprint("-%c", ARGC()));
+ /* No-op for compatibility */
break;
case 'c':
cflag = 1;