From 64667fe63ba9dd78adb9c4abf04bc3e4e25a0fd7 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Fri, 21 Sep 2018 01:22:11 +0200
Subject: mtd-utils: Instead of doing preprocessor magic, just output off_t as
 long long

Fix warnings abot PRIdoff_t in libmtd.c, in mtd_read (and mtd_write):

In file included from ../git/lib/libmtd.c:40:0:
../git/lib/libmtd.c: In function 'mtd_read':
../git/include/common.h:110:18: warning: format '%ld' expects argument of
 type 'long int', but argument 5 has type 'off_t {aka long long int}'
 [-Wformat=]

../git/include/common.h:120:2: note: in expansion of macro 'errmsg'
  errmsg(fmt, ##__VA_ARGS__);                                         \
  ^~~~~~
../git/lib/libmtd.c:1082:10: note: in expansion of macro 'sys_errmsg'
   return sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t,
          ^~~~~~~~~~

/usr/lib/klibc/include/inttypes.h:28:17: note: format string is defined here
 #define PRId32 "d"

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
 include/common.h | 18 ------------------
 1 file changed, 18 deletions(-)

(limited to 'include')

diff --git a/include/common.h b/include/common.h
index ece2287..2f24645 100644
--- a/include/common.h
+++ b/include/common.h
@@ -69,24 +69,6 @@ extern "C" {
 #define O_CLOEXEC 0
 #endif
 
-/* define a print format specifier for off_t */
-#if (SIZEOF_OFF_T >= 8)
-#define PRIxoff_t PRIx64
-#define PRIdoff_t PRId64
-#else
-#define PRIxoff_t "l"PRIx32
-#define PRIdoff_t "l"PRId32
-#endif
-
-/* define a print format specifier for loff_t */
-#if (SIZEOF_LOFF_T >= 8)
-#define PRIxloff_t PRIx64
-#define PRIdloff_t PRId64
-#else
-#define PRIxloff_t "l"PRIx32
-#define PRIdloff_t "l"PRId32
-#endif
-
 /* Verbose messages */
 #define bareverbose(verbose, fmt, ...) do {                        \
 	if (verbose)                                               \
-- 
cgit v1.2.3