summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 12:57:50 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-04 12:57:50 +0000
commitd80efa726fcb355ff6a45acc49b4142c87fe41b9 (patch)
tree7aa5c20469e6c104827c6efe34863e1cdbc76042 /gcc
parent9a5b4d700058c15a5e10de62e857195b01f90084 (diff)
downloadgcc-d80efa726fcb355ff6a45acc49b4142c87fe41b9.tar.gz
* doc/cpp.texi: Don't document what we do for ill-formed expressions.
* doc/cppopts.texi: Clarify processing of command-line defines. libcpp: PR preprocessor/16192 PR preprocessor/15913 PR preprocessor/15572 * expr.c (_cpp_parse_expr): Handle remaining cases where an expression is missing. * init.c (post_options): Traditional cpp doesn't do // comments. testsuite: * gcc.dg/cpp/if-mop.c: Two new testcases. * gcc.dg/cpp/trad/comment-3.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84080 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/cpp.texi3
-rw-r--r--gcc/doc/cppopts.texi13
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-mop.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/comment-3.c6
6 files changed, 30 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index afe489f1325..5f635ca21b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
+
+ * doc/cpp.texi: Don't document what we do for ill-formed expressions.
+ * doc/cppopts.texi: Clarify processing of command-line defines.
+
2004-07-04 Gerald Pfeifer <gerald@pfeifer.com>
* doc/contrib.texi (Contributors): Adjust link for GNU Classpath.
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 62151645c68..631992d5173 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -2965,9 +2965,6 @@ expression, and may give different results in some cases. If the value
comes out to be nonzero, the @samp{#if} succeeds and the @var{controlled
text} is included; otherwise it is skipped.
-If @var{expression} is not correctly formed, GCC issues an error and
-treats the conditional as having failed.
-
@node Defined
@subsection Defined
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 1b6307b2215..a6b7eb44fbb 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -16,11 +16,14 @@
Predefine @var{name} as a macro, with definition @code{1}.
@item -D @var{name}=@var{definition}
-Predefine @var{name} as a macro, with definition @var{definition}.
-There are no restrictions on the contents of @var{definition}, but if
-you are invoking the preprocessor from a shell or shell-like program you
-may need to use the shell's quoting syntax to protect characters such as
-spaces that have a meaning in the shell syntax.
+The contents of @var{definition} are tokenized and processed as if
+they appeared during translation phase three in a @samp{#define}
+directive. In particular, the definition will be truncated by
+embedded newline characters.
+
+If you are invoking the preprocessor from a shell or shell-like
+program you may need to use the shell's quoting syntax to protect
+characters such as spaces that have a meaning in the shell syntax.
If you wish to define a function-like macro on the command line, write
its argument list with surrounding parentheses before the equals sign
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1ca7e1a0a1f..9f03b45a6c1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
+
+ * gcc.dg/cpp/if-mop.c: Two new testcases.
+ * gcc.dg/cpp/trad/comment-3.c: New.
+
2004-07-04 Paul Brook <paul@codesourcery.com>
* gfortran.fortran-torture/compile/implicit_1.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/cpp/if-mop.c b/gcc/testsuite/gcc.dg/cpp/if-mop.c
index 9202740e6b1..119c7392e06 100644
--- a/gcc/testsuite/gcc.dg/cpp/if-mop.c
+++ b/gcc/testsuite/gcc.dg/cpp/if-mop.c
@@ -23,3 +23,9 @@
#if (2) 4 * 2 /* { dg-error "missing bin" "close paren then immediate" } */
#endif
+
+#if == 2 /* { dg-error "no left op" } */
+#endif
+
+#if (==2) /* { dg-error "no left op" } */
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
new file mode 100644
index 00000000000..e2710ad5629
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
@@ -0,0 +1,6 @@
+/* Test we don't accept C++ comments. */
+
+/* { dg-do preprocess } */
+
+#if 0
+#endif // /* { dg-warning "extra tokens" } */