From a09d4744294e28a19e7f785e85a361d2cd34c25e Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 4 Jul 2004 12:57:50 +0000 Subject: re PR preprocessor/16192 (Bug in expression evaluation when operand is missing) * 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. From-SVN: r84080 --- gcc/doc/cpp.texi | 3 --- gcc/doc/cppopts.texi | 13 ++++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gcc/doc') diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 6215164..631992d 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 1b6307b..a6b7eb4 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 -- cgit v1.1