bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-cpio] [PATCH] Fix mismatched definitions


From: Victor Westerhuis
Subject: [Bug-cpio] [PATCH] Fix mismatched definitions
Date: Mon, 8 Jul 2019 01:51:04 +0200

When compiling with LTO enabled, GCC turned up two mismatches
between declarations and definitions.

One was a difference between a declaration in src/extern.h and
a definition in src/filemode.c. I resolved it in favor of
the definition.

The other one is a wrong declaration of xalloc and xrealloc in
src/dstring.c. I resolved that by including the header that
declares them properly.
---
 src/dstring.c | 3 +--
 src/extern.h  | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/dstring.c b/src/dstring.c
index ddad4c8..766578f 100644
--- a/src/dstring.c
+++ b/src/dstring.c
@@ -29,8 +29,7 @@
 #endif
 #include "dstring.h"
 
-char *xmalloc (unsigned n);
-char *xrealloc (char *p, unsigned n);
+#include <xalloc.h>
 
 /* Initialiaze dynamic string STRING with space for SIZE characters.  */
 
diff --git a/src/extern.h b/src/extern.h
index 6fa2089..ffb43e9 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -127,7 +127,7 @@ int link_to_name (char *link_name, char *link_target);
 char *dirname (char *path);
 
 /* filemode.c */
-void mode_string (unsigned int mode, char *str);
+void mode_string (unsigned short mode, char *str);
 
 /* idcache.c */
 char *getgroup (gid_t gid);
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]