[Bug libstdc++/123406] [16 Regression] 27_io/print/1.cc 27_io/print/2.cc 27_io/print/3.cc on newlib targets since r16-4350

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 6 20:18:40 GMT 2026


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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Hmm, so maybe like this:

  AC_MSG_CHECKING([whether flockfile and putc_unlocked are defined in
<stdio.h>])
  AC_TRY_COMPILE([
  #include <stdio.h>
  #if ! defined(__CYGWIN__) && __has_include(<newlib.h>)
  #error No usable flockfile on non-cygwin newlib targets
  #endif
  ],[
    FILE* f = ::fopen("", "");
    ::flockfile(f);
    ::putc_unlocked(' ', f);
    ::funlockfile(f);
    ::fclose(f);
  ],[ac_stdio_locking=yes],[ac_stdio_locking=no])
  AC_MSG_RESULT($ac_stdio_locking)


More information about the Gcc-bugs mailing list