[PATCH iproute2] dcb: Fix compilation warning about reallocarray

Subsystems: the rest

STALE1996d

2 messages, 1 author, 2021-02-22 · open the first message on its own page

[PATCH iproute2] dcb: Fix compilation warning about reallocarray

From: Roi Dayan <hidden>
Date: 2021-02-22 12:10:56

To use reallocarray we need to add bsd/stdlib.h.

dcb_app.c: In function ‘dcb_app_table_push’:
dcb_app.c:68:25: warning: implicit declaration of function ‘reallocarray’; did you mean ‘realloc’?

Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
Signed-off-by: Roi Dayan <redacted>
---
 dcb/dcb.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index 6640deef5688..32896c4d5732 100644
--- a/dcb/dcb.c
+++ b/dcb/dcb.c
@@ -5,6 +5,7 @@
 #include <linux/dcbnl.h>
 #include <libmnl/libmnl.h>
 #include <getopt.h>
+#include <bsd/stdlib.h>
 
 #include "dcb.h"
 #include "mnl_utils.h"
-- 
2.8.0

Re: [PATCH iproute2] dcb: Fix compilation warning about reallocarray

From: Roi Dayan <hidden>
Date: 2021-02-22 12:12:48


On 2021-02-22 2:09 PM, Roi Dayan wrote:
quoted hunk
To use reallocarray we need to add bsd/stdlib.h.

dcb_app.c: In function ‘dcb_app_table_push’:
dcb_app.c:68:25: warning: implicit declaration of function ‘reallocarray’; did you mean ‘realloc’?

Fixes: 8e9bed1493f5 ("dcb: Add a subtool for the DCB APP object")
Signed-off-by: Roi Dayan <redacted>
---
  dcb/dcb.c | 1 +
  1 file changed, 1 insertion(+)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index 6640deef5688..32896c4d5732 100644
--- a/dcb/dcb.c
+++ b/dcb/dcb.c
@@ -5,6 +5,7 @@
  #include <linux/dcbnl.h>
  #include <libmnl/libmnl.h>
  #include <getopt.h>
+#include <bsd/stdlib.h>
  
  #include "dcb.h"
  #include "mnl_utils.h"
sorry for the resend. please ignore. sent v2 of the patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help