1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
From: Robert Luberda <robert@debian.org>
Date: Tue, 5 Jun 2018 00:21:33 +0200
Subject: Fix more gcc warnings
---
config.h.in | 4 ++++
configure.in | 6 +++---
super.c | 5 ++---
utils.c | 4 ++--
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/config.h.in b/config.h.in
index 1f0763b..ec99976 100644
--- a/config.h.in
+++ b/config.h.in
@@ -47,6 +47,10 @@
/* Define if on Linux or other glibc system */
#undef _BSD_SOURCE
+
+/* Define if on Linux or other glibc system */
+#undef _DEFAULT_SOURCE
+
/* For SunOS, define major and minor version numbers (computed in the
* configure script); for convenience, if on SunOS 5.x, also define SUNOS5.
*/
diff --git a/configure.in b/configure.in
index 0ffc310..6122677 100644
--- a/configure.in
+++ b/configure.in
@@ -36,13 +36,13 @@ if test "$Uname" = HP-UX ; then
AC_DEFINE_UNQUOTED(HPUX_MINOR,$Minor)
elif test "$Uname" = Linux ; then
- AC_DEFINE(_BSD_SOURCE)
+ AC_DEFINE(_DEFAULT_SOURCE)
elif test "$Uname" = GNU/kFreeBSD ; then
- AC_DEFINE(_BSD_SOURCE)
+ AC_DEFINE(_DEFAULT_SOURCE)
elif test "$Uname" = GNU ; then # Hurd
- AC_DEFINE(_BSD_SOURCE)
+ AC_DEFINE(_DEFAULT_SOURCE)
elif test "$Uname" = OSF1 ; then
AC_DEFINE(_OSF_SOURCE)
diff --git a/super.c b/super.c
index 1c21886..f951203 100644
--- a/super.c
+++ b/super.c
@@ -662,9 +662,8 @@ char **o_file, **r_path;
l = findgid(1, localinfo.group);
if (l == -1)
return Error(0,0,"Invalid gid specified after option -G\n");
- else
- userinfo.orig_gid = l;
- userinfo.caller.pw_gid = l;
+ userinfo.orig_gid = l;
+ userinfo.caller.pw_gid = l;
break;
case 'M':
it_came_from_cmdline = 1;
diff --git a/utils.c b/utils.c
index 08a04fb..f8ce9bb 100644
--- a/utils.c
+++ b/utils.c
@@ -2106,14 +2106,14 @@ void *
my_malloc(size_t size)
{
void *p = malloc(size);
- printf("my_malloc(%d) -> %p\n", size, p);
+ printf("my_malloc(%ld) -> %p\n", size, p);
return p;
}
void *
my_realloc(void *ptr, size_t size)
{
void *p = realloc(ptr, size);
- printf("my_realloc(%p, %d) -> %p\n", ptr, size, p);
+ printf("my_realloc(%p, %ld) -> %p\n", ptr, size, p);
return p;
}
void
|