LIU Hao wrote:
在 2024-02-19 15:56, Christian Franke 写道:
The __MINGW_FORTIFY_LEVEL set in _mingw_mac.h has no effect if a
program including Win32 API headers like windows.h is compiled for
Cygwin (same applies possibly to MSYS2). The __MINGW_FORTIFY_LEVEL
only affects Libc includes which are not present in the Cygwin Win32
API header package
(https://cygwin.com/packages/summary/w32api-headers.html). Cygwin
provides its own libc headers with different (and more limited)
_FORTIFY_SOURCE support.
So the idea is that `__MINGW_FORTIFY_LEVEL` should only be defined
when a user asks for the mingw-w64 CRT; in the case of Cygwin,
mingw-w64 headers are included but the CRT is the Cygwin CRT, so it
shouldn't be defined; is that right? The patch should be sensible. Let
me have a look later.
It does no harm to define __MINGW_FORTIFY_LEVEL to 0 in the !__MINGW32__
case as done with the patch. Leaving it undefined would make no
difference for Cygwin builds.
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public