diff mbox series

[iproute2] dcb: Fix compilation warning about reallocarray

Message ID 20210222105105.10213-1-roid@nvidia.com (mailing list archive)
State Superseded
Delegated to: David Ahern
Headers show
Series [iproute2] dcb: Fix compilation warning about reallocarray | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Roi Dayan Feb. 22, 2021, 10:51 a.m. UTC
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 <roid@nvidia.com>
---
 dcb/dcb.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Roi Dayan Feb. 22, 2021, 11:15 a.m. UTC | #1
On 2021-02-22 12:51 PM, Roi Dayan wrote:
> 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 <roid@nvidia.com>
> ---
>   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"
> 

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.
diff mbox series

Patch

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"