Skip to content

Commit

Permalink
tests: include string.h for memcpy
Browse files Browse the repository at this point in the history
clang in the openembedded CI reports a build error:

    ../git/tests/mctp-ops-test.c:67: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]
       67 |         memcpy(&sd, CMSG_DATA(cmsg), sizeof(int));
          |         ^
    ../git/tests/mctp-ops-test.c:67:2: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
    1 error generated.

Add the required header.

Fixes: 0bac17d ("tests: introduce MCTP infrastructure test facility")
Reported-by: Khem Raj <[email protected]>
Signed-off-by: Jeremy Kerr <[email protected]>
  • Loading branch information
jk-ozlabs committed Oct 24, 2024
1 parent 1ff9636 commit fbd42a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/mctp-ops-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include <sys/ioctl.h>
Expand Down

0 comments on commit fbd42a7

Please sign in to comment.