]> granicus.if.org Git - strace/commitdiff
tests: workaround clang -Wunneeded-internal-declaration bug
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 16 Sep 2018 09:48:16 +0000 (09:48 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 16 Sep 2018 09:48:16 +0000 (09:48 +0000)
* tests/execve.c (main): Explicitly mark q_envp variable as used
to workaround clang -Wunneeded-internal-declaration bug.
* tests/execveat.c (main): Likewise.
* tests/nsyscalls.c (main): Explicitly mark syscallent variable as used
to workaround clang -Wunneeded-internal-declaration bug.

Closes: https://github.com/strace/strace/issues/78
tests/execve.c
tests/execveat.c
tests/nsyscalls.c

index c1dedfcc7a22abf62479db017393ac6f5cc05b41..ce291fe1d09b1f8a7109cd57a2992b358a086ae0 100644 (file)
@@ -78,6 +78,7 @@ main(void)
 
        tail_argv[ARRAY_SIZE(q_argv)] = NULL;
        tail_envp[ARRAY_SIZE(q_envp)] = NULL;
+       (void) q_envp;  /* workaround for clang bug #33068 */
 
        execve(FILENAME, tail_argv, tail_envp);
        printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]"
index 853e26c4a35626017f2d536417d1a369092e1a77..f4c88d1bcc57420d27fde7469d03bb2a15f4c753 100644 (file)
@@ -83,6 +83,7 @@ main(void)
 
        tail_argv[ARRAY_SIZE(q_argv)] = NULL;
        tail_envp[ARRAY_SIZE(q_envp)] = NULL;
+       (void) q_envp;  /* workaround for clang bug #33068 */
 
        syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100);
        printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]"
index e2ebbf99bdc1668675a63986da2f87eb3b5a2f5e..e35442321042ddd97ef6de102df7030b9458e87d 100644 (file)
@@ -119,6 +119,7 @@ main(int argc, char *argv[])
 #endif
 
        test_syscall(ARRAY_SIZE(syscallent));
+       (void) syscallent;      /* workaround for clang bug #33068 */
 
 #ifdef SYS_socket_subcall
        test_syscall(SYS_socket_subcall + 1);