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

            Bug ID: 119658
           Summary: Better support for freestanding env on Windows
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

See the following for reference:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117432#c18
https://gcc.gnu.org/legacy-ml/gcc-patches/2010-01/msg01034.html
https://sourceforge.net/p/mingw-w64/bugs/970/

Long ago, mingw-w64 imported the GCC version of several header files and
modified them to support Windows.  GCC was then modified to not install its own
in preference to the ones from mingw-w64.  These have not been kept in sync,
and it's better to maintain this in one location.  For example, the above
mentioned PR117432 highlights a particular test case that failed due to lack of
support of a C23 feature in stdarg.h.

Andrew suggested on IRC to use __has_include_next and #include_next on the GCC
side to detect if any mingw-w64 customizations are present, for instance in a
stdarg.ext.h file.  Then, on the mingw-w64 side, we can maintain just those
aspects that need to be customized.  This would require changes on both sides,
but at least the GCC stdarg.h file would again be installed.

This likely applies to any of the freestanding environment headers described
here:
https://en.cppreference.com/w/c/language/conformance

Currently, that is the following:
float.h
iso646.h
limits.h
stdalign.h
stdarg.h
stdbool.h
stddef.h
stdint.h
stdnoreturn.h
stdbit.h

Reply via email to