[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:23:27 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:23 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
====================================================================== 

---------------------------------------------------------------------- 
 (0117019) seanbright (manager) - 2010-01-21 09:23
 https://issues.asterisk.org/view.php?id=16666#c117019 
---------------------------------------------------------------------- 
Are you add -Wall to CFLAGS specifically?  If so, why? 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-01-21 09:23 seanbright     Note Added: 0117019                          
======================================================================




More information about the asterisk-bugs mailing list