[PATCH iproute2] ipstats: Define MIN function to fix undefined references

Subsystems: the rest

STALE1449d

2 messages, 2 authors, 2022-08-17 · open the first message on its own page

[PATCH iproute2] ipstats: Define MIN function to fix undefined references

From: Nick Hainke <hidden>
Date: 2022-08-06 08:26:44

Fixes errors in the form of:
 in function `ipstats_show_64':
 <artificial>:(.text+0x4e30): undefined reference to `MIN'

Signed-off-by: Nick Hainke <redacted>
---
 ip/ipstats.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/ip/ipstats.c b/ip/ipstats.c
index 5cdd15ae..2f500fc8 100644
--- a/ip/ipstats.c
+++ b/ip/ipstats.c
@@ -6,6 +6,10 @@
 #include "utils.h"
 #include "ip_common.h"
 
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
 struct ipstats_stat_dump_filters {
 	/* mask[0] filters outer attributes. Then individual nests have their
 	 * filtering mask at the index of the nested attribute.
-- 
2.37.1

Re: [PATCH iproute2] ipstats: Define MIN function to fix undefined references

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2022-08-17 02:03:42

On Sat,  6 Aug 2022 10:24:06 +0200
Nick Hainke [off-list ref] wrote:
quoted hunk
Fixes errors in the form of:
 in function `ipstats_show_64':
 <artificial>:(.text+0x4e30): undefined reference to `MIN'

Signed-off-by: Nick Hainke <redacted>
---
 ip/ipstats.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/ip/ipstats.c b/ip/ipstats.c
index 5cdd15ae..2f500fc8 100644
--- a/ip/ipstats.c
+++ b/ip/ipstats.c
@@ -6,6 +6,10 @@
 #include "utils.h"
 #include "ip_common.h"
 
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
 struct ipstats_stat_dump_filters {
 	/* mask[0] filters outer attributes. Then individual nests have their
 	 * filtering mask at the index of the nested attribute
Not sure what non-standard headers you are using,
but this already addressed in main branch by:

commit cf6b60c504d4be5e1df2b2745e55d677967831d0
Author: Changhyeok Bae [off-list ref]
Date:   Tue Aug 9 04:01:05 2022 +0000

    ipstats: Add param.h for musl
    
    Fix build error for musl
    | /usr/src/debug/iproute2/5.19.0-r0/iproute2-5.19.0/ip/ipstats.c:231: undefined reference to `MIN'
    
    Signed-off-by: Changhyeok Bae [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help