autoconf-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #7223] AX_PTHREAD's test program in AC_TRY_LINK always fails with


From: anonymous
Subject: [patch #7223] AX_PTHREAD's test program in AC_TRY_LINK always fails with -Werror
Date: Tue, 15 Jun 2010 10:32:05 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100408 Gentoo Firefox/3.6.3

URL:
  <http://savannah.gnu.org/patch/?7223>

                 Summary: AX_PTHREAD's test program in AC_TRY_LINK always
fails with -Werror
                 Project: GNU Autoconf Archive
            Submitted by: None
            Submitted on: Tue 15 Jun 2010 10:32:04 AM UTC
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The test program generated by AX_PTHREAD's AC_TRY_LINK invocation generates a
compiler warning (on Linux, using GCC 4).  When building with "-Wall -Werror"
in CFLAGS, as done during development to catch unexpected warnings, this turns
into a compiler error; hence, all of the AC_TRY_LINK invocations fail, and the
macro fails to detect any suitable compiler/linker flags for pthreads usage.

A sample from config.log showing the error follows.

configure:16038: result: no
configure:15936: checking whether pthreads work without any flags
configure:16029: gcc -o conftest -O3 -g -Wall -Werror -pipe
-fvisibility=hidden -Wl,-O1 -Wl,--as-needed    conftest.c   >&5
cc1: warnings being treated as errors
conftest.c: In function 'main':
conftest.c:31: error: 'th' is used uninitialized in this function

Please find attached a patch to ax_pthread.m4 which fixes the issue, by
placing pthread_create before pthread_join in the test program.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 15 Jun 2010 10:32:04 AM UTC  Name: ax_pthread_werror.patch  Size:
704B   By: None
Fix compiler warning in AC_TRY_LINK test program
<http://savannah.gnu.org/patch/download.php?file_id=20753>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?7223>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]