Skip to contentSkip to conversation

dcb: Fix compilation warning about reallocarray

PATCH In review Roi Dayan 1 participant 2 messages Feb 22, 2021

Subsystems (2)
lore
Share & tools
lore

Roi Dayan

author
#0 lore raw

PATCH 1/1 dcb: Fix compilation warning about reallocarray

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")
---
 dcb/dcb.c | 1 +
 1 file changed, 1 insertion(+)
dcb/dcb.c +1 -0
index 6640deef5688..32896c4d5732 100644
@@ -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"
Signature · 1 line
2.8.0
author
#1 lore raw
Quoted 17 lines · Roi Dayan

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")
---
  dcb/dcb.c | 1 +
  1 file changed, 1 insertion(+)
dcb/dcb.c +0 -0
index 6640deef5688..32896c4d5732 100644

dcb/dcb.c line 11

Quoted 7 lines
dcb/dcb.c +1 -0
@@ -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"

It seems I need this include in old centos distro but not in fedora 27 for example as it is part of glibc. don't merge this please.