diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-03 18:09:53 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-03 18:09:53 +0200 |
commit | 76c102e548ee76884c94770e727f2ead6cfa5538 (patch) | |
tree | 7a0b0ebe298ffb1203e9a668b1c9e224c250d3d0 /sys/src/cmd/cc | |
parent | 87b66bade20523cbaa4368acab277994efd19ce8 (diff) |
apply sources patch cc-cpp-c99-comm
When running "?c -p ...", ensure the backend cpp recognizes C++ comments.
2c(1) states that the compilers recognize // comments, and the bare compilers
do. But if you invoke the compiler with '-p', the backend cpp process
doesn't handle // comments properly unless you also give ?c the undocumented
'-+' option (which it passes through to cpp).
Diffstat (limited to 'sys/src/cmd/cc')
-rw-r--r-- | sys/src/cmd/cc/lex.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/src/cmd/cc/lex.c b/sys/src/cmd/cc/lex.c index 2652cb8f8..68a566ba0 100644 --- a/sys/src/cmd/cc/lex.c +++ b/sys/src/cmd/cc/lex.c @@ -242,14 +242,12 @@ compile(char *file, char **defs, int ndef) close(fd[1]); av[0] = CPP; i = 1; + sprint(opt, "-+"); + av[i++] = strdup(opt); if(debug['.']){ sprint(opt, "-."); av[i++] = strdup(opt); } - if(debug['+']) { - sprint(opt, "-+"); - av[i++] = strdup(opt); - } for(c = 0; c < ndef; c++) { sprint(opt, "-D%s", defs[c]); av[i++] = strdup(opt); |