https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82528

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, I also thought of bug 82272.  The challenge with having the macros true
and false expand to some built-ins (like __true and __false) is that it would
be at odds with the C requirements that they be suitable for use in #if
preprocessing directives and expand to the integer constants 1 and 0.  At a
minimum, the preprocessor would need to be made aware of these built-ins.  The
more esoteric  problems stemming from having them expand to non-literals is in
preprocessor tricks like:

  #include <stdbool.h>

  #define CAT(a, b)  a ## b
  #define CONCAT(a, b) CAT (a, b)

  int i = CONCAT(1, true);

It's not clear that the standard actually requires the above to expand to '11'
(as opposed to causing an error if true were defined to (1), i.e., 1 in
parentheses) so maybe this is a non-issue.  As H. Peter Anvin suggests in the
related bug, it might be helpful to get this clarified and perhaps even
tightened up for C2X.

Reply via email to