From c2d494a0190961d82c23b9e2fd120e16a150a767 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Thu, 1 Oct 2009 21:33:24 +0000 Subject: [PATCH] * src/gdb/testsuite/gdb.base/shr1.c: Use %p in format string. * src/gdb/testsuite/gdb.base/unload.c: Avoid warning in fprintf. * src/gdb/testsuite/gdb.base/watchpoint-solib.c: Idem. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/shr1.c | 2 +- gdb/testsuite/gdb.base/unload.c | 7 +++++-- gdb/testsuite/gdb.base/watchpoint-solib.c | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1ab841181af..2f4799ea921 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-10-01 Pierre Muller + + * src/gdb/testsuite/gdb.base/shr1.c: Use %p in format string. + * src/gdb/testsuite/gdb.base/unload.c: Avoid warning in fprintf. + * src/gdb/testsuite/gdb.base/watchpoint-solib.c: Idem. + 2009-10-01 Pierre Muller * gdb.base/fileio.c (test_lseek): typecast ofs_t ret variable to diff --git a/gdb/testsuite/gdb.base/shr1.c b/gdb/testsuite/gdb.base/shr1.c index a0257e40233..117119a608f 100644 --- a/gdb/testsuite/gdb.base/shr1.c +++ b/gdb/testsuite/gdb.base/shr1.c @@ -25,7 +25,7 @@ int x; sg = 6.6; sgi++; sgs = 8; - printf("address of sgs is 0x%x\n", &sgs); + printf("address of sgs is %p\n", &sgs); return 2*x; } diff --git a/gdb/testsuite/gdb.base/unload.c b/gdb/testsuite/gdb.base/unload.c index a47084920e0..b8434cdc0f0 100644 --- a/gdb/testsuite/gdb.base/unload.c +++ b/gdb/testsuite/gdb.base/unload.c @@ -27,7 +27,6 @@ # define dlsym(handle, func) GetProcAddress (handle, func) #endif #define dlclose(handle) FreeLibrary (handle) -#define dlerror() "error %d occurred", GetLastError () #else #include #endif @@ -53,7 +52,11 @@ int main() if (!unloadshr) { - fprintf (stderr, dlerror ()); +#ifdef __WIN32__ + fprintf (stderr, "error %d occurred", GetLastError ()); +#else + fprintf (stderr, "%s", dlerror ()); +#endif exit (1); } diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.c b/gdb/testsuite/gdb.base/watchpoint-solib.c index 86fc253f966..96cc4dc8d77 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.c +++ b/gdb/testsuite/gdb.base/watchpoint-solib.c @@ -27,7 +27,6 @@ # define dlsym(handle, func) GetProcAddress (handle, func) #endif #define dlclose(handle) FreeLibrary (handle) -#define dlerror() "error %d occurred", GetLastError () #else #include #endif @@ -42,7 +41,11 @@ void open_shlib () if (!handle) { - fprintf (stderr, dlerror ()); +#ifdef __WIN32__ + fprintf (stderr, "error %d occurred", GetLastError ()); +#else + fprintf (stderr, "%s", dlerror ()); +#endif exit (1); } -- 2.30.2