News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

gcc4.7 can't build codeblocks

Started by xunxun, March 01, 2012, 09:20:25 AM

Previous topic - Next topic

MortenMacFly

Quote from: reckless on May 19, 2012, 09:44:14 AM
@ Morten. Only with the patches from here + -fpermissive in the compiler vars.
What patches are left? The help-plugin is up-to-date. Is there something else missing?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

xunxun

Quote from: MortenMacFly on May 19, 2012, 02:53:49 PM
Quote from: reckless on May 19, 2012, 09:44:14 AM
@ Morten. Only with the patches from here + -fpermissive in the compiler vars.
What patches are left? The help-plugin is up-to-date. Is there something else missing?

You can see

http://forums.next.codeblocks.org/index.php/topic,16039.msg109945.html#msg109945
Regards,
xunxun

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

reckless

patched before trunk update so didnt know. Ok nothing to report then.

Jenna

Quote from: xunxun on April 16, 2012, 05:56:03 PM
-fpermissive can't fix all things (especially in contrib plugins), maybe you can try SharkCZ's patches.

Hope Jens will fix soon.

Long time ago:
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
commit e70c8a008439072718760876b048deae1ec74c27
Author: Jens Lody <jens@codeblocks.org>
Date:   Mon Aug 6 23:30:49 2012 +0200

    * gcc 4.7 fixes

Index: src/include/scripting/bindings/sc_base_types.h
===================================================================
--- src/include/scripting/bindings/sc_base_types.h
+++ src/include/scripting/bindings/sc_base_types.h
@@ -33,6 +33,7 @@ DECLARE_INSTANCE_TYPE(wxPoint);
DECLARE_INSTANCE_TYPE(wxSize);
DECLARE_INSTANCE_TYPE(wxString);

+using SqPlus::GetTypeName;
// C::B primitives and types
DECLARE_INSTANCE_TYPE(ConfigManager);
DECLARE_INSTANCE_TYPE(EditorManager);
@@ -59,6 +60,7 @@ namespace SqPlus \
     inline T Get(TypeWrapper<T>,HSQUIRRELVM v,int idx) { SQInteger i; SQPLUS_CHECK_GET(sq_getinteger(v,idx,&i)); return (T)i; } \
}

+using SqPlus::Push;
DECLARE_ENUM_TYPE(wxPathFormat);
DECLARE_ENUM_TYPE(wxPathNormalize);
DECLARE_ENUM_TYPE(PrintColourMode);
Index: src/plugins/contrib/codesnippets/codesnippets.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippets.cpp
+++ src/plugins/contrib/codesnippets/codesnippets.cpp
@@ -93,7 +93,6 @@ CodeSnippets::CodeSnippets()
     m_bMouseLeftKeyDown = false;
     m_bMouseIsDragging = false;
     m_bDragCursorOn = false;
-    m_pDragCursor = false;
     m_MouseDownX = m_MouseDownY = 0;
     m_MouseUpX = m_MouseUpY = 0;
     #if !wxCHECK_VERSION(2, 8, 12)
Index: src/plugins/contrib/help_plugin/defs.h
===================================================================
--- src/plugins/contrib/help_plugin/defs.h
+++ src/plugins/contrib/help_plugin/defs.h
@@ -297,7 +297,7 @@ class QMap : public std::map<Key, T>

         int remove(const Key &k)
         {
-            return erase(k);
+            return this->erase(k);
         }
};

Index: src/plugins/debuggergdb/gdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/gdb_driver.cpp
+++ src/plugins/debuggergdb/gdb_driver.cpp
@@ -82,6 +82,7 @@ static wxRegEx reInferiorExited2(wxT("^\\[[Ii]nferior[ \\t].+[ \\t]exited[ \\t]w
                                  wxRE_EXTENDED);

// scripting support
+using SqPlus::Push;
DECLARE_INSTANCE_TYPE(GDB_driver);

GDB_driver::GDB_driver(DebuggerGDB* plugin)



Any feedback welcome!

MortenMacFly

Quote from: jens on August 07, 2012, 12:31:35 AM
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
Is this the same you posted in the other thread?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on August 07, 2012, 06:33:51 AM
Quote from: jens on August 07, 2012, 12:31:35 AM
After many fixes from killerbot to silent warnings on gcc4.7 and a  pm from him, it looks like I found a solution for the "-fpermissive"-desaster:
Is this the same you posted in the other thread?
Yes, but this one is for the public to test it.

It works fine here on fedora 64-bit and gcc4.7, but I did not test it on other platforms and with older compilers.
I don't think it can break anything, just want to be sure, before committing it.

killerbot

#52
see my comment in the other thread

EDIT : which not everyone can see :
duplicating here :

works fine for me too, however I would change one thing to the patch:

you just removed :     m_pDragCursor = false;

Now the member is not init-ed ==>


   m_pDragCursor = 0;


Jenna

Quote from: killerbot on August 07, 2012, 07:47:17 AM
you just removed :     m_pDragCursor = false;

Now the member is not init-ed ==>


    m_pDragCursor = 0;



It was initialised at the end of the constructor anyway (that's why I just removed the wrong initialisation):
    m_pDragCursor = new wxCursor(wxCURSOR_HAND);

To be sure it's 0 in case of a not working initialisation, we can preset it to 0.

killerbot

no you are absolutely correct, no need to set it. I overlooked that line.

And to be really nice : all of them could have been done in the initializer list :-)
But that's another story.

Let's give people time to object to the patch till this evening ?

Jenna

#55
Quote from: killerbot on August 07, 2012, 08:20:09 AM
And to be really nice : all of them could have been done in the initializer list :-)
But that's another story.
And we could do this in many places I guess.

Quote from: killerbot on August 07, 2012, 08:20:09 AM
Let's give people time to object to the patch till this evening ?
Yes, and I will try to compile it with an older gcc (4.2 if I remember correctly 4.4, I do not use my windows installation on my laptop often) on windows.

Alpha

Patch builds and runs with no apparent issues (GCC 4.6, Windows XP).

Jenna

I committed at to trunk last evening  (svn r8206).
C::B should compile without -fpermissive now.

MortenMacFly

Quote from: jens on August 08, 2012, 08:33:56 AM
C::B should compile without -fpermissive now.
Cools stuff. Now all thats needed on windows is a stable GCC 4.7.x compiler... :-)

Maybe we should nag TDM all together... Harhar...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

I already kindly did last week  8)
Maybe we should send him some nice beers ...