[Home]

Summary:ASTERISK-15485: [patch] Check on ac_cv_pthread_once_needsbraces fails
Reporter:Romain Bignon (romain_proformatique)Labels:
Date Opened:2010-01-21 07:43:55.000-0600Date Closed:2010-01-21 09:32:49.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk_pthread_once_check.patch
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
Comments:By: Sean Bright (seanbright) 2010-01-21 09:23:27.000-0600

Are you add -Wall to CFLAGS specifically?  If so, why?

By: Digium Subversion (svnbot) 2010-01-21 09:25:47.000-0600

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 ASTERISK-15485)
Reported by: romain_proformatique

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

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

By: Digium Subversion (svnbot) 2010-01-21 09:27:43.000-0600

Repository: asterisk
Revision: 241938

_U  trunk/
U   trunk/configure
U   trunk/configure.ac

------------------------------------------------------------------------
r241938 | seanbright | 2010-01-21 09:27:43 -0600 (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 ASTERISK-15485)
 Reported by: romain_proformatique
........

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

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

By: Digium Subversion (svnbot) 2010-01-21 09:31:03.000-0600

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 ASTERISK-15485)
   Reported by: romain_proformatique
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-01-21 09:31:44.000-0600

Repository: asterisk
Revision: 241940

_U  branches/1.6.1/
U   branches/1.6.1/configure
U   branches/1.6.1/configure.ac

------------------------------------------------------------------------
r241940 | seanbright | 2010-01-21 09:31:43 -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 ASTERISK-15485)
   Reported by: romain_proformatique
 ........
................

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

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

By: Digium Subversion (svnbot) 2010-01-21 09:32:49.000-0600

Repository: asterisk
Revision: 241941

_U  branches/1.6.2/
U   branches/1.6.2/configure
U   branches/1.6.2/configure.ac

------------------------------------------------------------------------
r241941 | seanbright | 2010-01-21 09:32:49 -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 ASTERISK-15485)
   Reported by: romain_proformatique
 ........
................

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

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