[PATCH 00/16] GDB testsuite cleanup, fix warnings with -std=gnu11

Andreas Arnez
2014-10-29T15:51:09Z

This patch set was triggered by the fact that upstream GCC has changed
the default C language dialect to 'gnu11':

https://gcc.gnu.org/ml/gcc/2014-10/msg00053.html

While the GDB source code doesn't seem to have any issues with that,
the test suite has, because it contains many functions without return
types and lots of implicit function declarations.

But while fixing these, I noticed that many test cases still rely on
literal line numbers and thus would fail after fixing the warnings.
Thus the first part of the patch set deals with eliminating literal
line numbers from various test cases.

Another observation is that many existing C source files in the test
suite contain code like this:

#ifdef PROTOTYPES
<prototyped function header>
#else
<old-style function header>
#endif

And that the prototyped variant would sometimes *fix* the warning.
However, the PROTOTYPES macro is never defined, hence the old-style
version is always used. Thus the second part of the patch series
performs some clean-up in this area by consequently migrating to the
prototyped variants and getting rid of such preprocessor conditionals.

The final part of the series then fixes the remaining warnings.

Andreas Arnez (16):
Eliminate literal line numbers in so-impl-ld.exp
Eliminate literal line numbers in dbx.exp
Eliminate literal line numbers in call-ar-st.exp
Eliminate literal line numbers in call-rt-st.exp
Eliminate literal line numbers in ending-run.exp
Eliminate literal line numbers in foll-exec.exp
Eliminate literal line numbers in jump.exp
Eliminate literal line numbers in shlib-call.exp
Eliminate literal line numbers in mi-console.exp
'callfuncs' test case: Fix typo in prototyped version
Drop non-prototype C function header variants: solib1.c
Drop non-prototype C function header variants: 'break' test case
Drop non-prototype C function header variants: 'list' test case
Drop non-prototype C function header variants: 'sepdebug' test case
GDB testsuite: drop non-prototype C function header variants
GDB testsuite: Fix warnings with -std=gnu11

gdb/testsuite/gdb.ada/cond_lang/foo.c | 2 +-
gdb/testsuite/gdb.base/advance.c | 10 +-
gdb/testsuite/gdb.base/annota1.c | 13 -
gdb/testsuite/gdb.base/annota3.c | 13 -
gdb/testsuite/gdb.base/async-shell.c | 2 +
gdb/testsuite/gdb.base/async.c | 28 +-
gdb/testsuite/gdb.base/attach-pie-misread.c | 1 +
gdb/testsuite/gdb.base/attach-twice.c | 1 +
gdb/testsuite/gdb.base/average.c | 17 +-
gdb/testsuite/gdb.base/break-interp-lib.c | 1 +
gdb/testsuite/gdb.base/break.c | 29 --
gdb/testsuite/gdb.base/break.exp | 29 +-
gdb/testsuite/gdb.base/break1.c | 7 -
gdb/testsuite/gdb.base/call-ar-st.c | 308 +--------------
gdb/testsuite/gdb.base/call-ar-st.exp | 165 ++++----
gdb/testsuite/gdb.base/call-rt-st.c | 157 +-------
gdb/testsuite/gdb.base/call-rt-st.exp | 11 +-
gdb/testsuite/gdb.base/call-sc.c | 7 +-
gdb/testsuite/gdb.base/call-strs.c | 22 --
gdb/testsuite/gdb.base/callfuncs.c | 131 +------
gdb/testsuite/gdb.base/catch-signal-fork.c | 2 +
gdb/testsuite/gdb.base/checkpoint.c | 7 +-
gdb/testsuite/gdb.base/code_elim2.c | 12 +-
gdb/testsuite/gdb.base/coremaker.c | 1 +
gdb/testsuite/gdb.base/dbx.exp | 16 +-
gdb/testsuite/gdb.base/dprintf-non-stop.c | 2 +
gdb/testsuite/gdb.base/dump.c | 2 +
gdb/testsuite/gdb.base/ending-run.c | 9 +-
gdb/testsuite/gdb.base/ending-run.exp | 38 +-
gdb/testsuite/gdb.base/execd-prog.c | 8 +-
gdb/testsuite/gdb.base/exprs.c | 7 -
gdb/testsuite/gdb.base/fileio.c | 1 +
gdb/testsuite/gdb.base/foll-exec.c | 8 +-
gdb/testsuite/gdb.base/foll-exec.exp | 37 +-
gdb/testsuite/gdb.base/foll-fork.c | 9 -
gdb/testsuite/gdb.base/foll-vfork.c | 4 -
gdb/testsuite/gdb.base/funcargs.c | 334 ----------------
gdb/testsuite/gdb.base/gcore.c | 6 +-
gdb/testsuite/gdb.base/global-var-nested-by-dso.c | 3 +
gdb/testsuite/gdb.base/huge.c | 1 +
gdb/testsuite/gdb.base/inferior-died.c | 1 +
gdb/testsuite/gdb.base/info-os.c | 1 +
gdb/testsuite/gdb.base/jump.c | 11 +-
gdb/testsuite/gdb.base/jump.exp | 29 +-
gdb/testsuite/gdb.base/langs0.c | 6 -
gdb/testsuite/gdb.base/langs1.c | 8 -
gdb/testsuite/gdb.base/langs2.c | 17 -
gdb/testsuite/gdb.base/list0.h | 8 +-
gdb/testsuite/gdb.base/list1.c | 20 +-
gdb/testsuite/gdb.base/mips_pro.c | 25 --
gdb/testsuite/gdb.base/multi-forks.c | 3 +-
gdb/testsuite/gdb.base/nodebug.c | 32 --
gdb/testsuite/gdb.base/opaque0.c | 2 -
gdb/testsuite/gdb.base/opaque1.c | 5 -
gdb/testsuite/gdb.base/pr10179-a.c | 1 +
gdb/testsuite/gdb.base/recurse.c | 6 -
gdb/testsuite/gdb.base/run.c | 11 -
gdb/testsuite/gdb.base/savedregs.c | 2 +
gdb/testsuite/gdb.base/scope0.c | 29 --
gdb/testsuite/gdb.base/scope1.c | 4 -
gdb/testsuite/gdb.base/sepdebug.c | 29 --
gdb/testsuite/gdb.base/sepdebug.exp | 30 +-
gdb/testsuite/gdb.base/setshow.c | 7 -
gdb/testsuite/gdb.base/setvar.c | 7 -
gdb/testsuite/gdb.base/shlib-call.exp | 2 +-
gdb/testsuite/gdb.base/shmain.c | 10 -
gdb/testsuite/gdb.base/shr1.c | 20 -
gdb/testsuite/gdb.base/shr2.c | 10 +-
gdb/testsuite/gdb.base/sigall.c | 426 ---------------------
gdb/testsuite/gdb.base/sigaltstack.c | 2 +
gdb/testsuite/gdb.base/siginfo.c | 1 +
gdb/testsuite/gdb.base/signals.c | 6 -
gdb/testsuite/gdb.base/skip-solib-lib.c | 8 +-
gdb/testsuite/gdb.base/so-impl-ld.exp | 4 +-
gdb/testsuite/gdb.base/so-indr-cl.c | 8 -
gdb/testsuite/gdb.base/solib-weak.c | 2 +
gdb/testsuite/gdb.base/solib1.c | 16 +-
gdb/testsuite/gdb.base/solib2.c | 5 -
gdb/testsuite/gdb.base/structs.c | 91 +----
gdb/testsuite/gdb.base/sum.c | 7 +-
gdb/testsuite/gdb.base/testenv.c | 1 +
gdb/testsuite/gdb.base/vforked-prog.c | 4 -
gdb/testsuite/gdb.base/watchpoint.c | 4 -
gdb/testsuite/gdb.base/weaklib1.c | 2 +
gdb/testsuite/gdb.base/weaklib2.c | 2 +
.../gdb.mi/mi-condbreak-call-thr-state-mt.c | 2 +
gdb/testsuite/gdb.mi/mi-console.c | 4 +-
gdb/testsuite/gdb.mi/mi-console.exp | 3 +-
gdb/testsuite/gdb.mi/mi-exit-code.c | 2 +
gdb/testsuite/gdb.mi/mi-stack.c | 9 +-
gdb/testsuite/gdb.mi/mi-syn-frame.c | 2 +
gdb/testsuite/gdb.mi/until.c | 2 +
gdb/testsuite/gdb.mi/watch-nonstop.c | 2 +
gdb/testsuite/gdb.python/py-events.c | 2 +
gdb/testsuite/gdb.python/py-finish-breakpoint.c | 1 +
gdb/testsuite/gdb.reverse/shr2.c | 8 -
gdb/testsuite/gdb.reverse/until-reverse.c | 29 --
gdb/testsuite/gdb.reverse/ur1.c | 7 -
gdb/testsuite/gdb.reverse/watch-reverse.c | 4 -
99 files changed, 319 insertions(+), 2144 deletions(-)

--
1.8.4.2