public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
@ 2019-11-16 14:41 Florian Weimer
0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2019-11-16 14:41 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=84df7a4637be8ecb545df3501cc724f3a4d53c46
commit 84df7a4637be8ecb545df3501cc724f3a4d53c46
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Nov 15 18:36:58 2019 +0100
hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
The trampoline code should really be rewritten in assembler because
this is all very undefined at the C level.
Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Diff:
---
sysdeps/mach/hurd/i386/init-first.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f1f1c40..5c21ebb 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -30,6 +30,7 @@
#include <ldsodefs.h>
#include <fpu_control.h>
+#include <libc-diag.h>
extern void __mach_init (void);
extern void __init_misc (int, char **, char **);
@@ -144,6 +145,12 @@ init1 (int argc, char *arg0, ...)
static inline void
init (int *data)
{
+ /* data is the address of the argc parameter to _dl_init_first or
+ doinit1 in _hurd_stack_setup, so the array subscripts are
+ undefined. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (10, "-Warray-bounds");
+
int argc = *data;
char **argv = (void *) (data + 1);
char **envp = &argv[argc + 1];
@@ -265,6 +272,8 @@ init (int *data)
restored by function return. */
asm volatile ("# a %0 c %1" : : "a" (usercode), "c" (&init1));
}
+
+ DIAG_POP_NEEDS_COMMENT; /* -Warray-bounds. */
}
/* These bits of inline assembler used to be located inside `init'.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-16 14:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16 14:41 [glibc] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] Florian Weimer
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).