PR27671, Poisoning TRUE / FALSE poisons Win32 system headers

Alan Modra amodra@gmail.com
Wed Mar 31 12:45:00 GMT 2021


Windows system headers make use of FALSE and TRUE.  So poisoning those
tokens wasn't a good idea, and unnecessary too.

Note that ideally we'd include all system headers before any
poisoning, but untangling all that will take quite a bit of work.  (To
get some idea you can undef and poisoned _FEATURES_H in bfd.h which is
a good way to catch any system headers included after bfd.h on linux.)

	PR 27671
	* bfd-in.h: Don't poison FALSE or TRUE.
	* bfd-in2.h: Regenerate.

diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 6f72cc4539b..1fbccca4161 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -120,7 +120,7 @@ typedef struct bfd bfd;
    success and FALSE on failure (unless they're a predicate).  */
 
 #ifdef POISON_BFD_BOOLEAN
-# pragma GCC poison bfd_boolean FALSE TRUE
+# pragma GCC poison bfd_boolean
 #else
 # define bfd_boolean bool
 # undef FALSE

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list