Thread (4 messages) flat view 4 messages, 2 authors, 2021-05-16

Re: [PATCH] Fix warning due to format mismatch for field width argument to fprintf()

From: Heiko Thiery <hidden>
Date: 2021-05-16 18:12:13

Hi all,

Am Sa., 15. Mai 2021 um 09:59 Uhr schrieb Heiko Thiery [off-list ref]:
Added Ben's other mail addresses.

Am Sa., 15. Mai 2021 um 08:49 Uhr schrieb Heiko Thiery [off-list ref]:
quoted
bnxt.c:66:54: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
   66 |   fprintf(stdout, "Length is too short, expected 0x%lx\n",
      |                                                    ~~^
      |                                                      |
      |                                                      long unsigned int
      |                                                    %x

Signed-off-by: Heiko Thiery <redacted>
---
 bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bnxt.c b/bnxt.c
index b46db72..0c62d1e 100644
--- a/bnxt.c
+++ b/bnxt.c
@@ -63,7 +63,7 @@ int bnxt_dump_regs(struct ethtool_drvinfo *info __maybe_unused, struct ethtool_r
                return 0;

        if (regs->len < (BNXT_PXP_REG_LEN + BNXT_PCIE_STATS_LEN)) {
-               fprintf(stdout, "Length is too short, expected 0x%lx\n",
+               fprintf(stdout, "Length is too short, expected 0x%x\n",
                        BNXT_PXP_REG_LEN + BNXT_PCIE_STATS_LEN);
This does not solve the issue. The provided patch only works on 32bit
systems. It seems there is a problem with 32bit vs 64bit.

-- 
Heiko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help