]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: gred: fix debug print
authorAndrea Claudi <aclaudi@redhat.com>
Wed, 3 Sep 2025 07:44:56 +0000 (09:44 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 26 Sep 2025 17:51:11 +0000 (10:51 -0700)
When build with -DDEBUG, tc build fails with:
q_gred.c: In function ‘init_gred’:
q_gred.c:53:17: error: passing argument 2 of ‘fprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
   53 |                 DPRINTF(stderr, "init_gred: invoked with %s\n", *argv);
      |                 ^~~~~~~
      |                 |
      |                 FILE *

This is due to the DPRINTF macro call. Indeed DPRINTF is defined as a
two-args macro when -DDEBUG is used, while it uses 3 args in this call.

Fix it simply dropping the useless first arg.

Fixes: aba5acdfdb34 ("(Logical change 1.3)")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_gred.c

index 84fc91244aed2a2b8a20bf77d6b7f4321a3f4400..95573218ad4782ff7d585f7ea84a6ee2fd896069 100644 (file)
@@ -50,7 +50,7 @@ static int init_gred(const struct qdisc_util *qu, int argc, char **argv,
        opt.def_DP = MAX_DPs;
 
        while (argc > 0) {
-               DPRINTF(stderr, "init_gred: invoked with %s\n", *argv);
+               DPRINTF("init_gred: invoked with %s\n", *argv);
                if (strcmp(*argv, "vqs") == 0 ||
                    strcmp(*argv, "DPs") == 0) {
                        NEXT_ARG();