[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #58467] stats.c inconsistent use of STAT_COUNTER_F
From: |
Mike Protts |
Subject: |
[lwip-devel] [bug #58467] stats.c inconsistent use of STAT_COUNTER_F |
Date: |
Sun, 31 May 2020 06:00:06 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; CrOS x86_64 12871.102.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36 |
URL:
<https://savannah.nongnu.org/bugs/?58467>
Summary: stats.c inconsistent use of STAT_COUNTER_F
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: mikeprotts
Submitted on: Sun 31 May 2020 10:00:02 AM UTC
Category: None
Severity: 3 - Normal
Item Group: Change Request
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: git head
_______________________________________________________
Details:
The code in stats.c, starting at line 104, is currently:
void
stats_display_mem(struct stats_mem *mem, const char *name)
{
LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name));
LWIP_PLATFORM_DIAG(("avail: %"MEM_SIZE_F"\n\t", mem->avail));
LWIP_PLATFORM_DIAG(("used: %"MEM_SIZE_F"\n\t", mem->used));
LWIP_PLATFORM_DIAG(("max: %"MEM_SIZE_F"\n\t", mem->max));
LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n", mem->err));
}
should be using STAT_COUNTER_F for consistency:
void
stats_display_mem(struct stats_mem *mem, const char *name)
{
LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name));
LWIP_PLATFORM_DIAG(("avail: %"STAT_COUNTER_F"\n\t", mem->avail));
LWIP_PLATFORM_DIAG(("used: %"STAT_COUNTER_F"\n\t", mem->used));
LWIP_PLATFORM_DIAG(("max: %"STAT_COUNTER_F"\n\t", mem->max));
LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n", mem->err));
}
This causes problems with platforms that do not support the h length modifier,
e.g. ChibiOS, as the value is replaced with the string literal "hu". With
version LWIP version 2.0.3 using LWIP_STATS_LARGE 1 caused all stats to print
correctly, with version 2.1.2 (and later) the error shows for these particular
cases.
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?58467>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #58467] stats.c inconsistent use of STAT_COUNTER_F,
Mike Protts <=