* [committed][gdb/testsuite] Fix local-static.exp with gcc-4.8
@ 2019-10-04 14:24 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-10-04 14:24 UTC (permalink / raw)
To: gdb-patches
Hi,
With gdb.cp/local-static.exp and gcc 4.8, I see:
...
gdb compile failed, src/gdb/testsuite/gdb.cp/local-static.c: In function 'main':
src/gdb/testsuite/gdb.cp/local-static.c:148:3: error: 'for' loop initial \
declarations are only allowed in C99 mode
for (int i = 0; i < 1000; i++)
^
src/gdb/testsuite/gdb.cp/local-static.c:148:3: note: use option -std=c99 or \
-std=gnu99 to compile your code
UNTESTED: gdb.cp/local-static.exp: c: failed to prepare
...
Fix this by moving the declaration of int i out of the for loop.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix local-static.exp with gcc-4.8
gdb/testsuite/ChangeLog:
2019-10-04 Tom de Vries <tdevries@suse.de>
* gdb.cp/local-static.c (main): Move declaration of int i out of the
for loop.
---
gdb/testsuite/gdb.cp/local-static.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.cp/local-static.c b/gdb/testsuite/gdb.cp/local-static.c
index 33ab2e352d2..6d9c368c87b 100644
--- a/gdb/testsuite/gdb.cp/local-static.c
+++ b/gdb/testsuite/gdb.cp/local-static.c
@@ -145,7 +145,9 @@ free_inline_func (void)
int
main ()
{
- for (int i = 0; i < 1000; i++)
+ int i;
+
+ for (i = 0; i < 1000; i++)
{
free_func ();
free_inline_func ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-04 14:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 14:24 [committed][gdb/testsuite] Fix local-static.exp with gcc-4.8 Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox