logo

cmd-timer

run command at a specific interval git clone https://anongit.hacktivis.me/git/cmd-timer.git
commit: 0768e774f281e882ffb9b83c8d13f9c73bdb0171
parent 0c2059b54b54f6dee1ff77f9ace71c0d9d3e5d2e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  5 Oct 2025 12:27:39 +0200

use int instead of char for getopt retval

    timer.c:67:50: warning: result of comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare]
       67 |         for(char c = -1; (c = getopt(argc, argv, ":w")) != -1;)
          |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~

Diffstat:

Mtimer.c2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/timer.c b/timer.c @@ -71,7 +71,7 @@ main(int argc, char *argv[]) bool opt_w = false; clockid_t clockid = CLOCK_REALTIME; - for(char c = -1; (c = getopt(argc, argv, ":c:w")) != -1;) + for(int c = -1; (c = getopt(argc, argv, ":c:w")) != -1;) { switch(c) {