summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rw-r--r--dpkg-deb/extract.c2
-rw-r--r--lib/dpkg/ar.c2
-rw-r--r--lib/dpkg/t/c-tarextract.c7
-rw-r--r--src/archives.c4
-rw-r--r--src/configure.c3
6 files changed, 12 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog
index 559e808ee..da3c8189a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
output substvar prefixed with “S:”.
* Make dpkg-source generate reproducible source packages when run
standalone, by honoring SOURCE_DATE_EPOCH.
+ * Portability:
+ - Cast off_t variables to intmax_t when printing them with "%jd".
* Perl modules:
- Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
- Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index b46851c06..d486c6de4 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -242,7 +242,7 @@ extracthalf(const char *debar, const char *dir,
r = read_line(ar->fd, ctrllenbuf, 1, sizeof(ctrllenbuf) - 1);
if (r < 0)
read_fail(r, debar, _("archive control member size"));
- if (sscanf(ctrllenbuf, "%jd%c%d", &ctrllennum, &nlc, &dummy) != 2 ||
+ if (sscanf(ctrllenbuf, "%jd%c%d", (intmax_t *)&ctrllennum, &nlc, &dummy) != 2 ||
nlc != '\n')
ohshit(_("archive has malformatted control member size '%s'"), ctrllenbuf);
diff --git a/lib/dpkg/ar.c b/lib/dpkg/ar.c
index 0aec95d8f..8a84c67ea 100644
--- a/lib/dpkg/ar.c
+++ b/lib/dpkg/ar.c
@@ -171,7 +171,7 @@ dpkg_ar_member_put_header(struct dpkg_ar *ar, struct dpkg_ar_member *member)
if (strlen(member->name) > 15)
ohshit(_("ar member name '%s' length too long"), member->name);
if (member->size > 9999999999L)
- ohshit(_("ar member size %jd too large"), member->size);
+ ohshit(_("ar member size %jd too large"), (intmax_t)member->size);
n = sprintf(header, "%-16s%-12lu%-6lu%-6lu%-8lo%-10jd`\n",
member->name, (unsigned long)member->time,
diff --git a/lib/dpkg/t/c-tarextract.c b/lib/dpkg/t/c-tarextract.c
index fd47fdddf..c235f4472 100644
--- a/lib/dpkg/t/c-tarextract.c
+++ b/lib/dpkg/t/c-tarextract.c
@@ -23,6 +23,7 @@
#include <sys/types.h>
#include <fcntl.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -56,15 +57,15 @@ tar_object(void *ctx, struct tar_entry *te)
switch (te->type) {
case TAR_FILETYPE_FILE0:
case TAR_FILETYPE_FILE:
- printf(" type=file size=%jd", te->size);
+ printf(" type=file size=%jd", (intmax_t)te->size);
break;
case TAR_FILETYPE_HARDLINK:
printf(" type=hardlink linkto=%s size=%jd",
- te->linkname, te->size);
+ te->linkname, (intmax_t)te->size);
break;
case TAR_FILETYPE_SYMLINK:
printf(" type=symlink linkto=%s size=%jd",
- te->linkname, te->size);
+ te->linkname, (intmax_t)te->size);
break;
case TAR_FILETYPE_DIR:
printf(" type=dir");
diff --git a/src/archives.c b/src/archives.c
index d07d4a450..71118ff79 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -548,7 +548,7 @@ tarobject_matches(struct tarcontext *tc,
ohshite(_("unable to read link '%.255s'"), fn_old);
else if (linksize != stab->st_size)
ohshit(_("symbolic link '%.250s' size has changed from %jd to %zd"),
- fn_old, stab->st_size, linksize);
+ fn_old, (intmax_t)stab->st_size, linksize);
linkname[linksize] = '\0';
if (strcmp(linkname, te->linkname) == 0) {
free(linkname);
@@ -1035,7 +1035,7 @@ tarobject(void *ctx, struct tar_entry *ti)
ohshite(_("unable to read link '%.255s'"), ti->name);
else if (r != stab.st_size)
ohshit(_("symbolic link '%.250s' size has changed from %jd to %zd"),
- fnamevb.buf, stab.st_size, r);
+ fnamevb.buf, (intmax_t)stab.st_size, r);
varbuf_trunc(&symlinkfn, r);
varbuf_end_str(&symlinkfn);
if (symlink(symlinkfn.buf,fnametmpvb.buf))
diff --git a/src/configure.c b/src/configure.c
index 690a85248..36b04306e 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -38,6 +38,7 @@
#include <dirent.h>
#include <termios.h>
#include <unistd.h>
+#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
@@ -759,7 +760,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
} else if (r != stab.st_size) {
warning(_("symbolic link '%.250s' size has "
"changed from %jd to %zd"),
- result->buf, stab.st_size, r);
+ result->buf, (intmax_t)stab.st_size, r);
return -1;
}
varbuf_trunc(&target, r);