[PATCH] D144331: [libc++][format] Implements formatter thread::id.

Manoj Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 13 11:34:08 PDT 2023


manojgupta added a comment.

Hmm, looking deeper, gdb (actually binutils), is doing something weird.

https://github.com/bminor/binutils-gdb/blob/master/include/safe-ctype.h

  /* Prevent the users of safe-ctype.h from accidently using the routines
     from ctype.h.  Initially, the approach was to produce an error when
     detecting that ctype.h has been included.  But this was causing
     trouble as ctype.h might get indirectly included as a result of
     including another system header (for instance gnulib's stdint.h).
     So we include ctype.h here and then immediately redefine its macros.  */
  
  #include <ctype.h>
  #undef isalpha
  #define isalpha(c) do_not_use_isalpha_with_safe_ctype
  #undef isalnum
  #define isalnum(c) do_not_use_isalnum_with_safe_ctype
  <snip>

So any use of isupper/islower etc will cause an error.
Why this patch is triggering it:
It adds an include of #include <__format/formatter_integral.h> which ends up including <locale> which has  internal definitions of isupper/islower causing clang to complain.
Any suggestions on what would be the right fix here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144331/new/

https://reviews.llvm.org/D144331



More information about the cfe-commits mailing list