public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_5-branch] Cygwin: Suppress array-bounds warning from NtCurrentTeb()
@ 2024-08-22 20:37 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-08-22 20:37 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4f8668a5b944326fddb8748a1b6c367936d742e8

commit 4f8668a5b944326fddb8748a1b6c367936d742e8
Author:     Jon Turney <jon.turney@dronecode.org.uk>
AuthorDate: Sun Aug 4 15:51:07 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Thu Aug 22 19:58:49 2024 +0200

    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>

Diff:
---
 winsup/cygwin/local_includes/winlean.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/winsup/cygwin/local_includes/winlean.h b/winsup/cygwin/local_includes/winlean.h
index 5bf1be262a00..62b651be6ee7 100644
--- a/winsup/cygwin/local_includes/winlean.h
+++ b/winsup/cygwin/local_includes/winlean.h
@@ -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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-22 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22 20:37 [newlib-cygwin/cygwin-3_5-branch] Cygwin: Suppress array-bounds warning from NtCurrentTeb() Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).