]> gcc.gnu.org Git - gcc.git/commitdiff
* cpp.texi (poison): Explain the macro expansion exception.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 13 Mar 2001 13:29:40 +0000 (13:29 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 13 Mar 2001 13:29:40 +0000 (13:29 +0000)
From-SVN: r40438

gcc/ChangeLog
gcc/cpp.texi

index 6bde0bc234f9d8934773b28bd5fda525cb7b1c37..b18f2733a606ae3bb96358a3ab6f13b388d582f2 100644 (file)
@@ -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
index 8bfa8c40245fc3b680ee517f7ab268637102bcf1..57da93332f7e7ef897627088df53063d3e4d6fe8 100644 (file)
@@ -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
This page took 0.074474 seconds and 5 git commands to generate.