Qpid
  1. Qpid
  2. QPID-3295

Under some conditions autoconf incorrectly detects that gcc doesn't support -Werror

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8, 0.10
    • Fix Version/s: 0.11
    • Component/s: Build Tools
    • Labels:

      Description

      If CFLAGS or CXXFLAGS contains "-Wall" when running configure, autoconf incorrectly detects that gcc doesn't support -Werror

      This is problematic because it is an important aspect of our policy that there should be no compiler warnings, and this bug stops this being enforced.

      Notably, the fedora package build has this issue and has been shipping with some unnoticed warnings for a while.

        Activity

        Hide
        Andrew Stitcher added a comment -

        Configure.ac uses the gl_COMPILER_FLAGS macro to test whether the compiler accepts a particular flag. However the program it uses to test compile has an unused variable in it.

        The program is:

        int main()

        { int x; ; return 0; }

        when compiled with -Wall -Werror this program reports an error and so autoconf thinks that -Werror isn't a valid flags for gcc

        Show
        Andrew Stitcher added a comment - Configure.ac uses the gl_COMPILER_FLAGS macro to test whether the compiler accepts a particular flag. However the program it uses to test compile has an unused variable in it. The program is: int main() { int x; ; return 0; } when compiled with -Wall -Werror this program reports an error and so autoconf thinks that -Werror isn't a valid flags for gcc
        Hide
        Andrew Stitcher added a comment -

        Since -Werror has been supported in every gcc version since at least 2.95 I think it's safe to enable -Werror unconditionally if the compiler is gcc.

        Show
        Andrew Stitcher added a comment - Since -Werror has been supported in every gcc version since at least 2.95 I think it's safe to enable -Werror unconditionally if the compiler is gcc.

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Andrew Stitcher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development