]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: fix `time_t` print without cast
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 30 Apr 2024 12:18:03 +0000 (14:18 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 2 May 2024 20:26:53 +0000 (22:26 +0200)
The gcc plugin wasn't warning about printing `suseconds_t` (which is
`time_t`, but in `struct timeval`.)  It needs to be printed with a cast,
just like `time_t`.  Luckily there is only one such usage.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/northbound_oper.c

index 7e7190f5a49e2a78cae078edd855a2b4585a1ef7..5f38c970c77ea67f9d66d9bae82406f7a4c08376 100644 (file)
@@ -1556,8 +1556,9 @@ static enum nb_error nb_op_yield(struct nb_op_yield_state *ys)
        unsigned long min_us = MAX(1, NB_OP_WALK_INTERVAL_US / 50000);
        struct timeval tv = { .tv_sec = 0, .tv_usec = min_us };
 
-       DEBUGD(&nb_dbg_events, "NB oper-state: yielding %s for %lus (should_batch %d)",
-              ys->xpath, tv.tv_usec, ys->should_batch);
+       DEBUGD(&nb_dbg_events,
+              "NB oper-state: yielding %s for %lldus (should_batch %d)",
+              ys->xpath, (long long)tv.tv_usec, ys->should_batch);
 
        if (ys->should_batch) {
                /*