Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 1/3] hwclock: fix signed/unsigned comparison warning on alpha
@ 2015-08-21 14:13 Andreas Henriksson
  2015-08-21 14:13 ` [PATCH 2/3] hwclock: fix fgets unchecked return value " Andreas Henriksson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andreas Henriksson @ 2015-08-21 14:13 UTC (permalink / raw)
  To: util-linux; +Cc: Andreas Henriksson

Fixes the following warning:
sys-utils/hwclock.c: In function 'manipulate_epoch':
sys-utils/hwclock.c:1465:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (epoch_opt == -1)

Full build log available on:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

Please note that this has never actually been (build-)tested on alpha,
but should hopefully resolve the warning. Note also that limits.h is
already included.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 sys-utils/hwclock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index f04cf2b..bdb98e2 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -137,7 +137,7 @@ int debug;
 bool badyear;
 
 /* User-specified epoch, used when rtc fails to return epoch. */
-unsigned long epoch_option = -1;
+unsigned long epoch_option = ULONG_MAX;
 
 /*
  * Almost all Award BIOS's made between 04/26/94 and 05/31/95 have a nasty
@@ -1452,7 +1452,7 @@ manipulate_epoch(const bool getepoch,
 			printf(_("Kernel is assuming an epoch value of %lu\n"),
 			       epoch);
 	} else if (setepoch) {
-		if (epoch_opt == -1)
+		if (epoch_opt == ULONG_MAX)
 			warnx(_
 			      ("To set the epoch value, you must use the 'epoch' "
 			       "option to tell to what value to set it."));
-- 
2.1.4


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

end of thread, other threads:[~2015-09-07  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-21 14:13 [PATCH 1/3] hwclock: fix signed/unsigned comparison warning on alpha Andreas Henriksson
2015-08-21 14:13 ` [PATCH 2/3] hwclock: fix fgets unchecked return value " Andreas Henriksson
2015-08-21 14:13 ` [PATCH 3/3] hwclock: fix iopl implicit declaration " Andreas Henriksson
2015-08-24  8:58 ` [PATCH 1/3] hwclock: fix signed/unsigned comparison " Karel Zak
2015-09-01 14:13   ` Andreas Henriksson
2015-09-07  6:52     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox