aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-10-28 12:39:22 +0000
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-11-13 10:20:44 +0100
commita59add0c2ed21c03efc8b39e333564d7713a7ccc (patch)
tree3832abef650cd187f011fa6fd19ed452442e3fa6 /gdb/testsuite/gdb.mi
parent3b5d59973315a2f2e77e9febd35034b4d51c716f (diff)
downloadfsf-binutils-gdb-a59add0c2ed21c03efc8b39e333564d7713a7ccc.zip
fsf-binutils-gdb-a59add0c2ed21c03efc8b39e333564d7713a7ccc.tar.gz
fsf-binutils-gdb-a59add0c2ed21c03efc8b39e333564d7713a7ccc.tar.bz2
GDB testsuite: Fix warnings with -std=gnu11
Since upstream GCC has changed the default C language dialect to 'gnu11', it yields multiple warnings in the GDB testsuite for missing function return types and implicit function declarations. This patch attempts to fix these. gdb/testsuite/ChangeLog: * gdb.ada/cond_lang/foo.c (callme): Add return type. * gdb.base/call-sc.c (zed): Likewise. * gdb.base/checkpoint.c (main): Likewise. * gdb.base/dump.c (main): Likewise. * gdb.base/gcore.c (main): Likewise. * gdb.base/huge.c (main): Likewise. * gdb.base/multi-forks.c (main): Likewise. * gdb.base/pr10179-a.c (main): Likewise. * gdb.base/savedregs.c (main): Likewise. * gdb.base/sigaltstack.c (main): Likewise. * gdb.base/siginfo.c (main): Likewise. * gdb.base/structs.c (zed): Likewise. * gdb.mi/mi-stack.c (callee3, callee2, callee1, main): Likewise. * gdb.mi/mi-syn-frame.c (main): Likewise. * gdb.mi/until.c (foo, main): Likewise. * gdb.base/global-var-nested-by-dso.c (b_main, c_main): Declare. * gdb.base/solib-weak.c (foo): Declare. * gdb.base/attach-twice.c: Include stdio.h. * gdb.base/weaklib1.c: Likewise. * gdb.base/weaklib2.c: Likewise. * gdb.base/catch-signal-fork.c: Include stdio.h and sys/wait.h. * gdb.mi/mi-condbreak-call-thr-state-mt.c: Include stdio.h and unistd.h. * gdb.base/attach-pie-misread.c: Include stdlib.h. * gdb.mi/mi-exit-code.c: Likewise. * gdb.base/break-interp-lib.c: Include string.h. * gdb.base/coremaker.c: Likewise. * gdb.base/testenv.c: Likewise. * gdb.python/py-finish-breakpoint.c: Likewise. * gdb.base/inferior-died.c: Include sys/wait.h. * gdb.base/fileio.c: Include time.h. * gdb.base/async-shell.c: Include unistd.h. * gdb.base/dprintf-non-stop.c: Likewise. * gdb.base/info-os.c: Likewise. * gdb.mi/mi-console.c: Likewise. * gdb.mi/watch-nonstop.c: Likewise. * gdb.python/py-events.c: Likewise. * gdb.base/async.c (baz): Move up before its invocation. * gdb.base/code_elim2.c (my_global_func): Likewise. * gdb.base/skip-solib-lib.c (multiply): Likewise. * gdb.base/advance.c (func2): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c2
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.c2
-rw-r--r--gdb/testsuite/gdb.mi/mi-exit-code.c2
-rw-r--r--gdb/testsuite/gdb.mi/mi-stack.c9
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.c2
-rw-r--r--gdb/testsuite/gdb.mi/until.c2
-rw-r--r--gdb/testsuite/gdb.mi/watch-nonstop.c2
7 files changed, 17 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
index e9ca92d..a466c54 100644
--- a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
+++ b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c
@@ -19,6 +19,8 @@
#include <stdlib.h>
#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
extern int test (void);
diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c
index 0cd2243..5ca046f 100644
--- a/gdb/testsuite/gdb.mi/mi-console.c
+++ b/gdb/testsuite/gdb.mi/mi-console.c
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
void
hello ()
{
diff --git a/gdb/testsuite/gdb.mi/mi-exit-code.c b/gdb/testsuite/gdb.mi/mi-exit-code.c
index df711a6..47bf15c 100644
--- a/gdb/testsuite/gdb.mi/mi-exit-code.c
+++ b/gdb/testsuite/gdb.mi/mi-exit-code.c
@@ -15,6 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/>. */
+#include <stdlib.h>
+
int exit_code = 0;
int
diff --git a/gdb/testsuite/gdb.mi/mi-stack.c b/gdb/testsuite/gdb.mi/mi-stack.c
index 5f2452c..d41f9a0 100644
--- a/gdb/testsuite/gdb.mi/mi-stack.c
+++ b/gdb/testsuite/gdb.mi/mi-stack.c
@@ -32,22 +32,23 @@ int callee4 (void)
C = A + B;
return 0;
}
-callee3 (char *strarg)
+
+void callee3 (char *strarg)
{
callee4 ();
}
-callee2 (int intarg, char *strarg)
+void callee2 (int intarg, char *strarg)
{
callee3 (strarg);
}
-callee1 (int intarg, char *strarg, double fltarg)
+void callee1 (int intarg, char *strarg, double fltarg)
{
callee2 (intarg, strarg);
}
-main ()
+int main ()
{
callee1 (2, "A string argument.", 3.5);
callee1 (2, "A string argument.", 3.5);
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c
index 332f246..c260112 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.c
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c
@@ -9,12 +9,14 @@ void subroutine (int);
void handler (int);
void have_a_very_merry_interrupt (void);
+int
main ()
{
foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
have_a_very_merry_interrupt ();
+ return 0;
}
void
diff --git a/gdb/testsuite/gdb.mi/until.c b/gdb/testsuite/gdb.mi/until.c
index df4a68d..21bdeda 100644
--- a/gdb/testsuite/gdb.mi/until.c
+++ b/gdb/testsuite/gdb.mi/until.c
@@ -1,3 +1,4 @@
+void
foo (void)
{
int i, x, y, z;
@@ -17,6 +18,7 @@ foo (void)
y = 10;
}
+int
main ()
{
int a = 1;
diff --git a/gdb/testsuite/gdb.mi/watch-nonstop.c b/gdb/testsuite/gdb.mi/watch-nonstop.c
index 3f8a18c..ea4406b 100644
--- a/gdb/testsuite/gdb.mi/watch-nonstop.c
+++ b/gdb/testsuite/gdb.mi/watch-nonstop.c
@@ -15,6 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <unistd.h>
+
int global;
int main ()