4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-08 18:19:08 +08:00

Cygwin: Suppress array-bounds warning from NtCurrentTeb()

This disables a warning seen with gcc 12 caused by intrinsics used by
the inline implementation of NtCurrentTeb() inside w32api headers.

> In function ‘long long unsigned int __readgsqword(unsigned int)’,
>     inlined from ‘_TEB* NtCurrentTeb()’ at /usr/include/w32api/winnt.h:10020:86,
> [...]
> /usr/include/w32api/psdk_inc/intrin-impl.h:838:1: error: array subscript 0 is outside array bounds of ‘long long unsigned int [0]’ [-Werror=array-bounds]

See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523#c6

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon Turney 2024-08-04 15:51:07 +01:00 committed by Corinna Vinschen
parent a6ffd8301b
commit 4f8668a5b9

View File

@ -53,7 +53,10 @@ details. */
#define __undef_CRITICAL
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#include <windows.h>
#pragma GCC diagnostic pop
#include <wincrypt.h>
#include <lmcons.h>
#include <ntdef.h>