Message: previous - next
Month: April 2012

Bug 958 opened - gcc 4.7 build failures

From: "David C. Rankin" <drankinatty@...>
Date: Thu, 05 Apr 2012 13:51:10 -0500

  I have opened a bug for handling gcc 4.7 build failure issues:

  I have also uploaded a complete set of build logs for the packages listed as
not building due to gcc 4.7 changes. I have set the priority to 'major'. Tim
will need to determine if this is what it should be or whether it should be
elevated for R14. Thankfully the packages that are affected is relatively small.
Thus far:

tdebase ( now requires -fpermissive )

  The big issue is that distros that ship or update to 4.7 will not be able to
build TDE until these issues are resolved. That eliminates Archlinux as the
build environment updates to build on the current stable release of all packages
(including gcc).

  Some build failures may be able to be handled by compiler/linker flags, where
code changes will be required for the rest. The primary culprit seems to be gcc
4.7 implementation of additional features and extensions from C11 and C++11. The
changes are summarized at:

  My guess for the lead suspect is:

G++ now correctly implements the two-phase lookup rules such that an unqualified
name used in a template must have an appropriate declaration found either in
scope at the point of definition of the template or by argument-dependent lookup
at the point of instantiation. As a result, code that relies on a second
unqualified lookup at the point of instantiation to find functions declared
after the template or in dependent bases will be rejected. The compiler will
suggest ways to fix affected code, and using the -fpermissive compiler flag will
allow the code to compile with a warning.

    template <class T>
    void f() { g(T()); } // error, g(int) not found by argument-dependent lookup
    void g(int) { } // fix by moving this declaration before the declaration of f

    template <class T>
    struct A: T {
      // error, B::g(B) not found by argument-dependent lookup
      void f() { g(T()); } // fix by using this->g or A::g

    struct B { void g(B); };

    int main()

  That would explain my need to use -fpermissive to build tdebase last night
where I never needed it before.

  Oh, well, the challenges of progress... Let's rip this apart and 'get her
fixed' :)

David C. Rankin, J.D.,P.E.