* [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
@ 2019-11-15 17:38 Florian Weimer (Code Review)
2019-11-15 17:38 ` [review v2] " Florian Weimer (Code Review)
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Florian Weimer (Code Review) @ 2019-11-15 17:38 UTC (permalink / raw)
To: libc-alpha; +Cc: Florian Weimer
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
The trampoline code should really be rewritten in assembler because
this is all very undefined at the C level.
Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f1f1c40..286d2a0 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,9 +145,16 @@
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];
+
struct hurd_startup_data *d;
/* Since the cthreads initialization code uses malloc, and the
@@ -265,6 +273,8 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 1
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newchange
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [review v2] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
@ 2019-11-15 17:38 ` Florian Weimer (Code Review)
2019-11-15 17:39 ` [review v3] " Florian Weimer (Code Review)
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer (Code Review) @ 2019-11-15 17:38 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
The trampoline code should really be rewritten in assembler because
this is all very undefined at the C level.
Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f1f1c40..286d2a0 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,9 +145,16 @@
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];
+
struct hurd_startup_data *d;
/* Since the cthreads initialization code uses malloc, and the
@@ -265,6 +273,8 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 2
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newpatchset
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [review v3] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
2019-11-15 17:38 ` [review v2] " Florian Weimer (Code Review)
@ 2019-11-15 17:39 ` Florian Weimer (Code Review)
2019-11-15 17:40 ` [review v4] hurd: Suppress " Florian Weimer (Code Review)
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer (Code Review) @ 2019-11-15 17:39 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
hurd: Fix GCC 10 -Warray-bounds warning in init-first.c
The trampoline code should really be rewritten in assembler because
this is all very undefined at the C level.
Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 9 insertions(+), 0 deletions(-)
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 @@
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 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 3
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newpatchset
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [review v4] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
2019-11-15 17:38 ` [review v2] " Florian Weimer (Code Review)
2019-11-15 17:39 ` [review v3] " Florian Weimer (Code Review)
@ 2019-11-15 17:40 ` Florian Weimer (Code Review)
2019-11-15 17:50 ` [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] Florian Weimer (Code Review)
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer (Code Review) @ 2019-11-15 17:40 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c
The trampoline code should really be rewritten in assembler because
this is all very undefined at the C level.
Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 9 insertions(+), 0 deletions(-)
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 @@
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 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newpatchset
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
` (2 preceding siblings ...)
2019-11-15 17:40 ` [review v4] hurd: Suppress " Florian Weimer (Code Review)
@ 2019-11-15 17:50 ` Florian Weimer (Code Review)
2019-11-16 11:55 ` Samuel Thibault
2019-11-16 14:50 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-16 14:50 ` Sourceware to Gerrit sync (Code Review)
5 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer (Code Review) @ 2019-11-15 17:50 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
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
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 9 insertions(+), 0 deletions(-)
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 @@
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 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 5
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newpatchset
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
2019-11-15 17:50 ` [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] Florian Weimer (Code Review)
@ 2019-11-16 11:55 ` Samuel Thibault
0 siblings, 0 replies; 8+ messages in thread
From: Samuel Thibault @ 2019-11-16 11:55 UTC (permalink / raw)
To: fweimer, libc-alpha
Florian Weimer (Code Review), le ven. 15 nov. 2019 12:50:46 -0500, a ecrit:
> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
> ......................................................................
>
> 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
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Thanks!
> ---
> M sysdeps/mach/hurd/i386/init-first.c
> 1 file changed, 9 insertions(+), 0 deletions(-)
>
>
>
> 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 @@
> 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 @@
> 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'.
>
> --
> Gerrit-Project: glibc
> Gerrit-Branch: master
> Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
> Gerrit-Change-Number: 657
> Gerrit-PatchSet: 5
> Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
> Gerrit-MessageType: newpatchset
>
--
Samuel
War doesn't prove who's right, just who's left.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pushed] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
` (3 preceding siblings ...)
2019-11-15 17:50 ` [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] Florian Weimer (Code Review)
@ 2019-11-16 14:50 ` Sourceware to Gerrit sync (Code Review)
2019-11-16 14:50 ` Sourceware to Gerrit sync (Code Review)
5 siblings, 0 replies; 8+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-11-16 14:50 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
The original change was created by Florian Weimer.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
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
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 9 insertions(+), 0 deletions(-)
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 @@
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 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 6
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: newpatchset
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [pushed] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097]
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
` (4 preceding siblings ...)
2019-11-16 14:50 ` [pushed] " Sourceware to Gerrit sync (Code Review)
@ 2019-11-16 14:50 ` Sourceware to Gerrit sync (Code Review)
5 siblings, 0 replies; 8+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-11-16 14:50 UTC (permalink / raw)
To: Florian Weimer, libc-alpha
Sourceware to Gerrit sync has submitted this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657
......................................................................
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
---
M sysdeps/mach/hurd/i386/init-first.c
1 file changed, 9 insertions(+), 0 deletions(-)
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 @@
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 @@
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'.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4
Gerrit-Change-Number: 657
Gerrit-PatchSet: 6
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: merged
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-11-16 14:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 17:38 [review] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c Florian Weimer (Code Review)
2019-11-15 17:38 ` [review v2] " Florian Weimer (Code Review)
2019-11-15 17:39 ` [review v3] " Florian Weimer (Code Review)
2019-11-15 17:40 ` [review v4] hurd: Suppress " Florian Weimer (Code Review)
2019-11-15 17:50 ` [review v5] hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] Florian Weimer (Code Review)
2019-11-16 11:55 ` Samuel Thibault
2019-11-16 14:50 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-16 14:50 ` Sourceware to Gerrit sync (Code Review)
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).