aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-03-13 13:29:40 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-03-13 13:29:40 +0000
commitbf4ab281678450284b14a53089c1f364132cb203 (patch)
treea61b19ab4ddb0df20e1986280a791f1fda4e3ada /gcc
parente5408e52405a113827a7558f2847dc5acb0bb710 (diff)
downloadgcc-bf4ab281678450284b14a53089c1f364132cb203.zip
gcc-bf4ab281678450284b14a53089c1f364132cb203.tar.gz
gcc-bf4ab281678450284b14a53089c1f364132cb203.tar.bz2
* cpp.texi (poison): Explain the macro expansion exception.
From-SVN: r40438
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cpp.texi16
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6bde0bc..b18f2733 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2001-03-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cpp.texi (poison): Explain the macro expansion exception.
+
2001-03-13 Jakub Jelinek <jakub@redhat.com>
* expr.c (store_expr): Add dont_store_target. If temp is already in
diff --git a/gcc/cpp.texi b/gcc/cpp.texi
index 8bfa8c4..57da933 100644
--- a/gcc/cpp.texi
+++ b/gcc/cpp.texi
@@ -1601,6 +1601,22 @@ sprintf(some_string, "hello");
@noindent
will produce an error.
+Note, if the poisoned identifier appears through the result of macro
+expansion it @emph{won't} cause an error. So if you poison an
+identifier you need not worry about system headers defining macros that
+use it.
+
+For example,
+
+@example
+#define strrchr rindex
+#pragma GCC poison rindex
+strrchr(some_string, 'h');
+@end example
+
+@noindent
+will not produce an error.
+
@node Macro Pitfalls,, Poisoning, Macros
@subsection Pitfalls and Subtleties of Macros
@cindex problems with macros