gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error while compiling on FreeBSD


From: Riccardo Mottola
Subject: Re: Error while compiling on FreeBSD
Date: Thu, 04 Dec 2014 19:33:33 +0100
User-agent: Mozilla/5.0 (X11; NetBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Hi,

On 12/02/14 07:57, Richard Frith-Macdonald wrote:
It seems there are two variants of pthread_setname_np and the autoconf script 
didn't know about them; it was just checking for pthread_setname_np or 
pthread_set_name_np
I have rewritten the tests so it should discriminate between the version which 
takes two arguments and the one that takes three.
I comitted the change to trunk so you can try it out (I don't have the 
different bsd systems to try it on).
shortly after I reported FreeBSD, I tried NetBSD and got the same error.
Now, after your patch, NetBSD is fixed, but FreeBSD still fails to compile.

NetBSD just gives a warning about the qualifier:


NSThread.m: In function '-[NSThread _setName:]':
NSThread.m:810:7: warning: passing argument 3 of 'pthread_setname_np' discards 'const' qualifier from pointer target type [enabled by default]
       result = PTHREAD_SETNAME(pthread_self(),
       ^
In file included from NSThread.m:46:0:
/usr/include/pthread.h:133:5: note: expected 'void *' but argument is of type 'const char *'
 int pthread_setname_np(pthread_t, const char *, void *);
     ^

While FreeBSD gives this error:
 Compiling file NSTask.m ...
 Compiling file NSThread.m ...
NSThread.m:810:16: error: too few arguments to function call, expected 2, have 1
      result = PTHREAD_SETNAME(pthread_self(),
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
././config.h:780:51: note: expanded from macro 'PTHREAD_SETNAME'
#define PTHREAD_SETNAME(a,b) pthread_set_name_np(b)
                             ~~~~~~~~~~~~~~~~~~~  ^
/usr/include/pthread_np.h:58:1: note: 'pthread_set_name_np' declared here
void pthread_set_name_np(pthread_t, const char *);
^
1 error generated.

The relevant configure test is I suppose:

configure:13718: checking for pthread_set_name_np
configure:13774: clang -o conftest -g -O2 -I/Local/Library/Headers -I/Local/Lib rary/Headers -I/System/Library/Headers -I/usr/local/include -L/Local/Library/Li braries -L/Local/Library/Libraries -L/System/Library/Libraries -L/usr/local/lib
conftest.c -lrt  -lpthread >&5
configure:13781: $? = 0
configure:13803: result: yes


Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]