Author Topic: sdk\compiler.cpp  (Read 5490 times)

sethjackson

  • Guest
sdk\compiler.cpp
« on: March 30, 2006, 09:17:28 pm »
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
// check for unique ID
if (!IsUniqueID(m_ID))
    cbThrow(_T("Compiler ID already exists for ") + m_Name);

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: sdk\compiler.cpp
« Reply #1 on: March 31, 2006, 01:09:53 am »
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:
Code
m_Name = _("Copy of ") + other.m_Name;
to something like:
Code
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.
« Last Edit: March 31, 2006, 01:13:58 am by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: sdk\compiler.cpp
« Reply #2 on: March 31, 2006, 11:38:35 am »
Fixed, thanks.
Be patient!
This bug will be fixed soon...

sethjackson

  • Guest
Re: sdk\compiler.cpp
« Reply #3 on: March 31, 2006, 02:00:12 pm »