util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] minor fixes for v2.33
@ 2018-09-25 22:37 Ruediger Meier
  2018-09-25 22:37 ` [PATCH 1/2] libfdisk: fix OSX compiler warning Ruediger Meier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ruediger Meier @ 2018-09-25 22:37 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Fix some minor issues seen on my travis -Werror build
on i386 and OSX.

Ruediger Meier (2):
  libfdisk: fix OSX compiler warning
  libfdisk: fix printf format modifier

 libfdisk/src/context.c | 8 +++++---
 libfdisk/src/script.c  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.13.7

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] libfdisk: fix OSX compiler warning
  2018-09-25 22:37 [PATCH 0/2] minor fixes for v2.33 Ruediger Meier
@ 2018-09-25 22:37 ` Ruediger Meier
  2018-09-25 22:37 ` [PATCH 2/2] libfdisk: fix printf format modifier Ruediger Meier
  2018-10-04  9:58 ` [PATCH 0/2] minor fixes for v2.33 Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Ruediger Meier @ 2018-09-25 22:37 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

libfdisk/src/context.c:1354:54: error: unused parameter 'cxt' [-Werror,-Wunused-parameter]
const char *fdisk_get_devmodel(struct fdisk_context *cxt)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 libfdisk/src/context.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c
index ad5f99de4..18ebeba18 100644
--- a/libfdisk/src/context.c
+++ b/libfdisk/src/context.c
@@ -1351,9 +1351,9 @@ dev_t fdisk_get_devno(struct fdisk_context *cxt)
  *
  * Returns: device model string or NULL.
  */
+#ifdef __linux__
 const char *fdisk_get_devmodel(struct fdisk_context *cxt)
 {
-#ifdef __linux__
 	assert(cxt);
 
 	if (cxt->dev_model_probed)
@@ -1369,11 +1369,13 @@ const char *fdisk_get_devmodel(struct fdisk_context *cxt)
 	}
 	cxt->dev_model_probed = 1;
 	return cxt->dev_model;
+}
 #else
+const char *fdisk_get_devmodel(struct fdisk_context *cxt __attribute__((__unused__)))
+{
 	return NULL;
-#endif
-
 }
+#endif
 
 /**
  * fdisk_get_devfd:
-- 
2.13.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] libfdisk: fix printf format modifier
  2018-09-25 22:37 [PATCH 0/2] minor fixes for v2.33 Ruediger Meier
  2018-09-25 22:37 ` [PATCH 1/2] libfdisk: fix OSX compiler warning Ruediger Meier
@ 2018-09-25 22:37 ` Ruediger Meier
  2018-10-04  9:58 ` [PATCH 0/2] minor fixes for v2.33 Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Ruediger Meier @ 2018-09-25 22:37 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

libfdisk/src/script.c: In function ‘fdisk_script_read_context’:
libfdisk/src/script.c:452:33: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
   snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
                                 ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 libfdisk/src/script.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
index 24c40f8ce..e7cf1254e 100644
--- a/libfdisk/src/script.c
+++ b/libfdisk/src/script.c
@@ -449,7 +449,7 @@ int fdisk_script_read_context(struct fdisk_script *dp, struct fdisk_context *cxt
 	if (!rc && fdisk_get_grain_size(cxt) != 2048 * 512) {
 		char buf[64];
 
-		snprintf(buf, sizeof(buf), "%zu", fdisk_get_grain_size(cxt));
+		snprintf(buf, sizeof(buf), "%lu", fdisk_get_grain_size(cxt));
 		rc = fdisk_script_set_header(dp, "grain", buf);
 	}
 
-- 
2.13.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] minor fixes for v2.33
  2018-09-25 22:37 [PATCH 0/2] minor fixes for v2.33 Ruediger Meier
  2018-09-25 22:37 ` [PATCH 1/2] libfdisk: fix OSX compiler warning Ruediger Meier
  2018-09-25 22:37 ` [PATCH 2/2] libfdisk: fix printf format modifier Ruediger Meier
@ 2018-10-04  9:58 ` Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2018-10-04  9:58 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux

On Wed, Sep 26, 2018 at 12:37:27AM +0200, Ruediger Meier wrote:
> Ruediger Meier (2):
>   libfdisk: fix OSX compiler warning
>   libfdisk: fix printf format modifier

Applied, thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-04 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-25 22:37 [PATCH 0/2] minor fixes for v2.33 Ruediger Meier
2018-09-25 22:37 ` [PATCH 1/2] libfdisk: fix OSX compiler warning Ruediger Meier
2018-09-25 22:37 ` [PATCH 2/2] libfdisk: fix printf format modifier Ruediger Meier
2018-10-04  9:58 ` [PATCH 0/2] minor fixes for v2.33 Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).