News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

sdk\compiler.cpp

Started by sethjackson, March 30, 2006, 09:17:28 PM

Previous topic - Next topic

sethjackson

Ok I was checking this bug.

http://developer.berlios.de/bugs/?func=detailbug&bug_id=6911&group_id=5358

I have Version 1.0 revision 2278 (gcc 3.4.4 Windows/unicode, build: Mar 30 2006 13:09:26)

Now if I do what he says C::B throws then crashes....

So here is what I did. My default compiler is GCC.

1. Settings -> Compiler and debugger.
2. Create a copy of GNU GCC Compiler.
3. Select GNU GCC Compiler (not the Copy of GNU GCC Compiler)
4. Create another copy of GCC.
5. C::B throws, then crashes.

Why? I would fix, but I don't know how.  :(

Oh and this is where it throws.

Code (cpp) Select

// check for unique ID
if (!IsUniqueID(m_ID))
    cbThrow(_T("Compiler ID already exists for ") + m_Name);

MortenMacFly

#1
Quote from: sethjackson on March 30, 2006, 09:17:28 PM
Why? I would fix, but I don't know how.  :(
It has to to with the copy constructor "Compiler::Compiler(const Compiler& other)" . If you change the line 67 in compiler .cpp from:
m_Name = _("Copy of ") + other.m_Name;
to something like:
m_Name = other.m_Name + m_CompilerIDs.Count();
It should always work correctly since m_CompilerIDs will grow in size each time a compiler is added. Unicode should be taken care of, so maybe a Print("%d"...) has to be used for the integer. Anyway: This is not really good because suddenly the compiler ID is dependend the order how I add "copies of compilers".
But maybe mandrav has a better solution?
With regards, Morten.
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]

mandrav

Be patient!
This bug will be fixed soon...