[libatomic, testsuite] Add missing include in atomic-generic.c
authorTom de Vries <tdevries@suse.de>
Mon, 7 Sep 2020 09:54:27 +0000 (11:54 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 7 Sep 2020 10:02:05 +0000 (12:02 +0200)
When compiling atomic-generic.c from the libatomic testsuite, we run into:
...
$ gcc src/libatomic/testsuite/libatomic.c/atomic-generic.c -latomic
src/libatomic/testsuite/libatomic.c/atomic-generic.c: In function ‘main’:
src/libatomic/testsuite/libatomic.c/atomic-generic.c:31:7: warning: \
  implicit declaration of function ‘memcmp’ [-Wimplicit-function-declaration]
   if (memcmp (&a, &zero, size))
       ^~~~~~
...

Fix this by adding the missing string.h include.

Tested on x86_64.

libatomic/ChangeLog:

* testsuite/libatomic.c/atomic-generic.c: Include string.h.

libatomic/testsuite/libatomic.c/atomic-generic.c

index 11ef6c5831da42422112909bf9fa10811a0ce8bc..662467ea82a9846266021090e2baeca0541e9eea 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <stdlib.h>
 #include <stdbool.h>
+#include <string.h>
 
 extern void abort();