diff mbox series

libmpathutils/uxsock.c: Include string.h for memcpy

Message ID 20250217200503.4166910-1-raj.khem@gmail.com (mailing list archive)
State New
Headers show
Series libmpathutils/uxsock.c: Include string.h for memcpy | expand

Commit Message

Khem Raj Feb. 17, 2025, 8:05 p.m. UTC
Fixes
uxsock.c:72:2: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Martin Wilck <mwilck@suse.com>
---
 libmpathutil/uxsock.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Benjamin Marzinski Feb. 17, 2025, 9:03 p.m. UTC | #1
On Mon, Feb 17, 2025 at 12:05:03PM -0800, Khem Raj wrote:
> Fixes
> uxsock.c:72:2: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Benjamin Marzinski <bmarzins@redhat.com>
> Cc: Martin Wilck <mwilck@suse.com>
> ---
>  libmpathutil/uxsock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libmpathutil/uxsock.c b/libmpathutil/uxsock.c
> index 2135476d..a474874e 100644
> --- a/libmpathutil/uxsock.c
> +++ b/libmpathutil/uxsock.c
> @@ -8,6 +8,7 @@
>  #include <stdlib.h>
>  #include <unistd.h>
>  #include <stdarg.h>
> +#include <string.h>
>  #include <fcntl.h>
>  #include <sys/ioctl.h>
>  #include <sys/types.h>
Martin Wilck Feb. 24, 2025, 10:03 p.m. UTC | #2
On Mon, 2025-02-17 at 16:03 -0500, Benjamin Marzinski wrote:
> On Mon, Feb 17, 2025 at 12:05:03PM -0800, Khem Raj wrote:
> > Fixes
> > uxsock.c:72:2: error: call to undeclared library function 'memcpy'
> > with type 'void *(void *, const void *, unsigned long)'; ISO C99
> > and later do not support implicit function declarations [-
> > Wimplicit-function-declaration]
> 
> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

Thanks, it turns out that we have this include already in the queue
branch, but I applied your patch on stable-0.11.y and stable-0.10.y.

Regards
Martin

> > 
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > Cc: Benjamin Marzinski <bmarzins@redhat.com>
> > Cc: Martin Wilck <mwilck@suse.com>
> > ---
> >  libmpathutil/uxsock.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/libmpathutil/uxsock.c b/libmpathutil/uxsock.c
> > index 2135476d..a474874e 100644
> > --- a/libmpathutil/uxsock.c
> > +++ b/libmpathutil/uxsock.c
> > @@ -8,6 +8,7 @@
> >  #include <stdlib.h>
> >  #include <unistd.h>
> >  #include <stdarg.h>
> > +#include <string.h>
> >  #include <fcntl.h>
> >  #include <sys/ioctl.h>
> >  #include <sys/types.h>
>
diff mbox series

Patch

diff --git a/libmpathutil/uxsock.c b/libmpathutil/uxsock.c
index 2135476d..a474874e 100644
--- a/libmpathutil/uxsock.c
+++ b/libmpathutil/uxsock.c
@@ -8,6 +8,7 @@ 
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <string.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>