[asterisk-bugs] [Asterisk 0016666]: [patch] Check on ac_cv_pthread_once_needsbraces fails

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jan 21 09:25:47 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16666 
====================================================================== 
Reported By:                romain_proformatique
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16666
Category:                   Core/BuildSystem
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.29 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 241765 
Request Review:              
====================================================================== 
Date Submitted:             2010-01-21 07:43 CST
Last Modified:              2010-01-21 09:25 CST
====================================================================== 
Summary:                    [patch] Check on ac_cv_pthread_once_needsbraces
fails
Description: 
On asterisk 2.4.29, there is a new check named
ac_cv_pthread_once_needsbraces to know if the pthread's PTHREAD_ONCE_INIT
macro needs to be used between braces.
It tries to compile a trivial program:

#include <pthread.h>
int main()
{
    pthread_once_t once = PTHREAD_ONCE_INIT;
    return 0;
}

If gcc fails, configuration.ac set ac_cv_pthread_once_needsbraces as
"yes".
But there is an other reason to fail, that's because the "once" variable
is not used. So, if -Wall is included in CFLAGS, it includes the
-Wunused-variable flag and it fails:

configure:11487: checking if PTHREAD_ONCE_INIT needs braces
configure:11503: cc -c -g -Wall -O2 -Werror -Wmissing-braces  conftest.c
>&5
cc1: warnings being treated as errors
conftest.c: In function 'main':
conftest.c:138: warning: unused variable 'once'
configure:11503: $? = 1
configure: failed program was:
[…]
configure:11511: result: yes
====================================================================== 

---------------------------------------------------------------------- 
 (0117020) svnbot (reporter) - 2010-01-21 09:25
 https://issues.asterisk.org/view.php?id=16666#c117020 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 241932

U   branches/1.4/configure
U   branches/1.4/configure.ac

------------------------------------------------------------------------
r241932 | seanbright | 2010-01-21 09:25:46 -0600 (Thu, 21 Jan 2010) | 5
lines

Fix configure check for PTHREAD_ONCE_INIT when manually adding -Wall to
CFLAGS.

(closes issue https://issues.asterisk.org/view.php?id=16666)
Reported by: romain_proformatique

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=241932 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-21 09:25 svnbot         Checkin                                      
2010-01-21 09:25 svnbot         Note Added: 0117020                          
======================================================================




More information about the asterisk-bugs mailing list