This patch adds -Wsign-compare and fixes the resulting warnings. Signed-off-by: Robert Schwebel --- Makefile | 2 +- cyclictest.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) Index: cyclictest.c =================================================================== --- cyclictest.c.orig +++ cyclictest.c @@ -117,7 +117,7 @@ static int kernvar(int mode, char *name, } } else if (mode == O_WRONLY) { snprintf(buffer, sizeof(buffer), "%d\n", *value); - if (write(procfilepath, buffer, strlen(buffer)) + if ((size_t)write(procfilepath, buffer, strlen(buffer)) == strlen(buffer)) retval = 0; } @@ -393,8 +393,8 @@ static int timermode = TIMER_ABSTIME; static int use_system; static int priority; static int num_threads = 1; -static int max_cycles; -static int clocksel = 0; +static unsigned long max_cycles; +static unsigned int clocksel = 0; static int verbose; static int quiet; static int interval = 1000; @@ -439,7 +439,7 @@ static void process_options (int argc, c case 'd': distance = atoi(optarg); break; case 'f': ftrace = 1; break; case 'i': interval = atoi(optarg); break; - case 'l': max_cycles = atoi(optarg); break; + case 'l': max_cycles = atol(optarg); break; case 'n': use_nanosleep = MODE_CLOCK_NANOSLEEP; break; case 'p': priority = atoi(optarg); break; case 'q': quiet = 1; break; @@ -451,7 +451,7 @@ static void process_options (int argc, c } } - if (clocksel < 0 || clocksel > ARRAY_SIZE(clocksources)) + if (clocksel < 1 || clocksel > ARRAY_SIZE(clocksources)) error = 1; if (priority < 0 || priority > 99) Index: Makefile =================================================================== --- Makefile.orig +++ Makefile @@ -1,6 +1,6 @@ TARGET=cyclictest -FLAGS= -Wall -Wno-nonnull -O2 +FLAGS= -Wall -Wno-nonnull -Wsign-compare -O2 LIBS = -lpthread -lrt all: cyclictest.c -- Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Handelsregister: Amtsgericht Hildesheim, HRA 2686 Hannoversche Str. 2, 31134 Hildesheim, Germany Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9