[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:31:03 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16666 
====================================================================== 
Reported By:                romain_proformatique
Assigned To:                seanbright
====================================================================== 
Project:                    Asterisk
Issue ID:                   16666
Category:                   Core/BuildSystem
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-01-21 07:43 CST
Last Modified:              2010-01-21 09:31 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
====================================================================== 

---------------------------------------------------------------------- 
 (0117022) svnbot (reporter) - 2010-01-21 09:31
 https://issues.asterisk.org/view.php?id=16666#c117022 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 241939

_U  branches/1.6.0/
U   branches/1.6.0/configure
U   branches/1.6.0/configure.ac

------------------------------------------------------------------------
r241939 | seanbright | 2010-01-21 09:31:03 -0600 (Thu, 21 Jan 2010) | 19
lines

Merged revisions 241938 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r241938 | seanbright | 2010-01-21 10:27:42 -0500 (Thu, 21 Jan 2010) | 12
lines
  
  Merged revisions 241932 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r241932 | seanbright | 2010-01-21 10:25:46 -0500 (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=241939 

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




More information about the asterisk-bugs mailing list