[asterisk-bugs] [JIRA] (ASTERISK-27711) [patch] BuildSystem: Avoid re-defining of pthread_* on NetBSD.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Sat Mar 3 03:32:13 CST 2018


Alexander Traud created ASTERISK-27711:
------------------------------------------

             Summary: [patch] BuildSystem: Avoid re-defining of pthread_* on NetBSD.
                 Key: ASTERISK-27711
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27711
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/BuildSystem
    Affects Versions: 13.19.2
         Environment: NetBSD 7.1.1
            Reporter: Alexander Traud
            Severity: Trivial


{code}include/asterisk/lock.h:629:0: warning: "pthread_cond_timedwait" redefined
/usr/include/pthread.h:332:0: note: this is the location of the previous definition
 #define pthread_cond_timedwait  __libc_cond_timedwait{code}Whenever the header file {{lock.h}} is included (directly or indirectly), the compiler gcc (tested 7.3.0, 6.4.0, and 4.8.5) emits warnings like the one above. Therefore, several hundred warnings like this are printed on the console, while making Asterisk.

In NetBSD (tested 7.1.1), two alternative approaches exist:
A) Add a define for __LIBPTHREAD_SOURCE__ to _ASTCFLAGS in Makefile, or
B) #undef all pthread_* in {{include/asterisk/lock.h}}.

Because those symbols might not be defined but functions on other platforms, I opted for alternative A. However, if more platforms are affected by this, alternative B is feasible via ifdef-then-undef.

The same issue was already found/posted four years ago in June 2013 by John Nemeth, member of the NetBSD team.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list