Author Topic: Edit Global Compiler Settings aborts  (Read 7314 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2877
Edit Global Compiler Settings aborts
« on: September 13, 2009, 03:47:10 pm »
When I attempt to edit the Global compiler settings, I get the Abort/Retry/Ignore message.

MSW XP sp2 SVN 5751.




Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Edit Global Compiler Settings aborts
« Reply #1 on: September 14, 2009, 01:17:40 am »
Confirmed on linux too.
Only happens (at least for me), if I add a custom-variable with a name not starting with a letter .
It happens because the name of the variable is used as key, when stored in default.conf .

configmanager.cpp tests for illegal characters as first letter of the key, and if it founds one it throws an exception.

I think we should either check the variable-name directly after the user added it in compiler-config-dialog or change the way we store it.
But the second would of course lead to changes in conf-file format and to incompatibilities with the actual version.
Any other ideas ?

By the way the same problem might happen at other places, where the user can edit the name of a key directly (if such keys exist).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Edit Global Compiler Settings aborts
« Reply #2 on: September 14, 2009, 06:37:31 am »
configmanager.cpp tests for illegal characters as first letter of the key, and if it founds one it throws an exception.
Well - maybe a trupid question, but why is "_" an illegal character, even for a key?
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Edit Global Compiler Settings aborts
« Reply #3 on: September 14, 2009, 07:08:32 am »
configmanager.cpp tests for illegal characters as first letter of the key, and if it founds one it throws an exception.
Well - maybe a trupid question, but why is "_" an illegal character, even for a key?
Don't know, it's implemented this way, only the first letter is tested. Might be a (Tiny-)XML restriction.

I did not dig into this deeper (it was a little late yesterday).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Edit Global Compiler Settings aborts
« Reply #4 on: September 14, 2009, 07:44:04 am »
Don't know, it's implemented this way, only the first letter is tested. Might be a (Tiny-)XML restriction.
Saw that, too now. Well I thinks it's a bug in configmanager cause "_" even as a starter is valid XML. I'm pretty sure tinyXML will accept that, too (will try anyways...) - so I suppose to fix configmanager. However - it won't fix the crash if the user does enter something invalid there... so some more thoughts on that are welcome. Probably Thomas has an idea - he's the godfather of configmanager IIR... ;-)
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