GNOME Bugzilla – Bug 660045
xsltproc/testThreads.c error: conversion to non-scalar type requested
Last modified: 2012-08-16 13:46:53 UTC
Created attachment 197417 [details] make log libxslt-1.1.26 configured for MinGW has compilation error gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../libxslt -I../libexslt -I.. -I../libxslt -I../libexslt -IC:/MinGW/include/libxml2 -g -O2 -Wall -g -O2 -Wall -MT testThreads.o -MD -MP -MF .deps/testThreads.Tpo -c -o testThreads.o testThreads.c testThreads.c: In function 'main': testThreads.c:203:6: error: conversion to non-scalar type requested testThreads.c:245:6: error: conversion to non-scalar type requested Similar to diff in testThreads.c between libxml2-git-snapshot and libxml2-2.7.8 patch for libxslt/xsltproc/testThreads.c would be: --- libxslt-1.1.26/xsltproc/testThreads.c 2009-08-14 11:14:22 +0400 +++ libxslt/xsltproc/testThreads.c 2011-09-25 11:49:35 +0400 @@ -198,10 +198,8 @@ */ printf("Pass 1\n"); for (repeat = 0;repeat < 500;repeat++) { - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (pthread_t) -1; - } + memset(results, 0, sizeof(*results)*num_threads); + memset(tid, 0xff, sizeof(*tid)*num_threads); for (i = 0; i < num_threads; i++) { ret = pthread_create(&tid[i], NULL, threadRoutine1, @@ -240,10 +238,8 @@ fprintf(stderr, "Main failed to compile stylesheet\n"); exit(1); } - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (pthread_t) -1; - } + memset(results, 0, sizeof(*results)*num_threads); + memset(tid, 0xff, sizeof(*tid)*num_threads); for (i = 0; i < num_threads; i++) { ret = pthread_create(&tid[i], NULL, threadRoutine2, (void *) cur);
Created attachment 197418 [details] [review] Suggested xsltproc/testThreads.c patch At least libxslt-1.1.26 was compiled successfully after patching
Created attachment 197419 [details] Log of libxslt-1.1.26 "./configure --prefix=`cd /mingw; pwd -W`"
Created attachment 204365 [details] [review] Alternative fix Here's a patch which uses pthread_self() instead of a manual set to -1, as done in https://bugzilla.gnome.org/show_bug.cgi?id=599241
Right, I actually went with the first way to keep the code similar to libxml2 equivalent: http://git.gnome.org/browse/libxslt/commit/?id=2d6e741ed9a5e54d48d394060590d151a3417dd7 thanks a lot ! Daniel