Bug #52

Core doesn't compile with GCC 4.6

Added by Jan Dolinár about 13 years ago. Updated about 13 years ago.

Status:ApprovedStart date:04/09/2011
Priority:UrgentDue date:
Assignee:Jan Dolinár% Done:

0%

Category:-Spent time:-
Target version:-

Description

Proposed patches attached for review.

gcc46patch.tar.gz (8.79 KB) Jan Dolinár, 04/09/2011 12:48 PM

History

#1 Updated by Miroslav Fidler about 13 years ago

Moved from wrong task:

Alternative solution to the ptrdiff_t problem in Algo.h could be adding somewhere

#if GCC_VERSION >= 40600
#include <stddef.h>

I guess that is actually a cleaner solution...

PS: Valuable resource for fixing GCC4.6 related issues is http://lists.fedoraproject.org/pipermail/devel/2011-February/148523.html

#2 Updated by Miroslav Fidler about 13 years ago

Applied...

Please, what is the issue with virtual destructor in Convert.h?!

#3 Updated by Jan Dolinár about 13 years ago

If there is no default constructor for Convert and NoConvert, then compilation of Convert.cpp result in these errors:

/home/h/upp-production/uppsrc/Core/Convert.cpp: In function ‘const Upp::Convert& Upp::StdConvert()’:
/home/h/upp-production/uppsrc/Core/Convert.cpp:318:1: error: uninitialized const ‘x’ [-fpermissive]
/home/h/upp-production/uppsrc/Core/Convert.h:25:7: note: ‘const class Upp::Convert’ has no user-provided default const
    ructor
/home/h/upp-production/uppsrc/Core/Convert.cpp: In function ‘const Upp::NoConvertClass& Upp::NoConvert()’:
/home/h/upp-production/uppsrc/Core/Convert.cpp:492:1: error: uninitialized const ‘x’ [-fpermissive]
/home/h/upp-production/uppsrc/Core/Convert.h:218:7: note: ‘const class Upp::NoConvertClass’ has no user-provided defau
    lt constructor

It is the same problem we've been fixing for Clang some time ago.

From the link in my previous post:

uninitialized const
    struct A { int a; A (); };
    struct B : public A { };
    const B b;

    now gets an error:
    error: uninitialized const ‘b’ [-fpermissive]
    note: ‘const struct B’ has no user-provided default constructor

    This is related to http://gcc.gnu.org/PR43890, B above doesn't
    have a user provided default ctor, so either an initializer
    needs to be provided, or the default ctor needs to be added.

#4 Updated by Miroslav Fidler about 13 years ago

  • Status changed from New to Ready for QA
  • Assignee changed from Miroslav Fidler to Jan Dolinár

OK, I have tried another way how to fix this, please check...

#5 Updated by Jan Dolinár about 13 years ago

  • Status changed from Ready for QA to Approved

Seems OK, everything compiles fine.

Also available in: Atom PDF