CC Anders.
Looks like it's reasonable to upstream that change.
Maxim.
On 07/15/15 17:03, Nicolas Morey-Chaisemartin wrote:
When adding both Wextra and Werror to CPPFLAGS, configure fails due to
a warning during the pthread configuration phase:
| #include <pthread.h>
| static void routine(void *a) { a = 0; }
| static void *start_routine(void *a) { return a; }
| int
| main ()
| {
| pthread_t th; pthread_attr_t attr;
| pthread_create(&th, 0, start_routine, 0);
| pthread_join(th, 0);
| pthread_attr_init(&attr);
| pthread_cleanup_push(routine, 0);
| pthread_cleanup_pop(0) /* ; */
| ;
| return 0;
| }
configure:19696: result: no
configure:19594: checking whether pthreads work without any flags
configure:19687: gcc -o conftest -g -O2 -Wall -Werror -Wextra conftest.c
>&5
conftest.c: In function 'routine':
conftest.c:64:51: error: parameter 'a' set but not used
[-Werror=unused-but-set-parameter]
static void routine(void *a) { a = 0; }
Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]>
---
m4/ax_pthread.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index d383ad5..c78b87d 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -219,7 +219,7 @@ for flag in $ax_pthread_flags; do
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
- static void routine(void *a) { a = 0; }
+ static void routine(void *a) { if(a) a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp