This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[pushed] gdb.base/info-os.c: Include stdlib.h (was: Re: GNU gdb (GDB) 7.9.50.20150222-cvs s390x-ibm-linux-gnu GIT commit: 96553a0cffb30d2ac6068eb71bed38ea7432073b)


Happened to notice this while skimming gdb-testers@:

> gdb compile failed, /gdb/testsuite/gdb.base/info-os.c: In function 'main':
> /gdb/testsuite/gdb.base/info-os.c:65:3: warning: implicit declaration of function 'atexit' [-Wimplicit-function-declaration]
>    atexit (ipc_cleanup);
>    ^
> FAIL: gdb.base/info-os.exp: cannot compile test program

I don't have newer GCC handy, but I'm sure this should fix it.  Pushed.

-------
>From e5b85ead638e4916ee188698e434dd1940e484e4 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Mon, 23 Feb 2015 14:03:48 +0000
Subject: [PATCH] gdb.base/info-os.c: Include stdlib.h

Fixes:

 > gdb compile failed, /gdb/testsuite/gdb.base/info-os.c: In function 'main':
 > /gdb/testsuite/gdb.base/info-os.c:65:3: warning: implicit declaration of function 'atexit' [-Wimplicit-function-declaration]
 >    atexit (ipc_cleanup);
 >    ^
 > FAIL: gdb.base/info-os.exp: cannot compile test program

with recent GCCs.

gdb/testsuite/ChangeLog:
2015-02-23  Pedro Alves  <palves@redhat.com>

	* gdb.base/info-os.c: Include stdlib.h.
---
 gdb/testsuite/ChangeLog          | 4 ++++
 gdb/testsuite/gdb.base/info-os.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8540979..276749e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-02-23  Pedro Alves  <palves@redhat.com>
+
+	* gdb.base/info-os.c: Include stdlib.h.
+
 2015-02-22  Doug Evans  <xdje42@gmail.com>
 
 	PR symtab/17855
diff --git a/gdb/testsuite/gdb.base/info-os.c b/gdb/testsuite/gdb.base/info-os.c
index 8ceaaff..5f91eef 100644
--- a/gdb/testsuite/gdb.base/info-os.c
+++ b/gdb/testsuite/gdb.base/info-os.c
@@ -23,6 +23,7 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
-- 
1.9.3



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]