Dear all,
I am having troubles adding a new file to a project. Whenever I try it I receive an error message: "An unhandled exception occurred. Press "Abort" to [...]". If I press "abort" I immediately receive the following error message:
An exception has been raised!
The application encountered an error at sdk\configmanager.cpp, on line 504.
The error message is:
The Configuration key 16 (child of node "editor" in namespace "editor") does not meet the standard for variable naming.
Variables names are required to start with a letter.
After that C::B freezes. If I press ignore I can continue working, but (of course) the file is not being created. I am using the CVS version as of today, Windows XP OS with wxWidgets 2.6.1. Does anybody else encounter the same problem?
Morten.
Here is a backtrace of the crash on linux:
...
#5 0xb7744f11 in std::terminate () from /usr/lib/libstdc++.so.6
#6 0xb774509c in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0xb7e2c46c in ConfigManager::AssertPath (this=0x83377c8, path=@0xbfca01ac)
at configmanager.cpp:504
#8 0xb7e2d843 in ConfigManager::Read (this=0x83377c8, name=@0xbfca024c,
str=0xbfca01f8) at configmanager.cpp:644
#9 0xb7e2da40 in ConfigManager::Read (this=0x83377c8, name=@0xbfca024c,
defaultVal=@0xbfca0254) at configmanager.cpp:624
#10 0xb7e59960 in EditorManager::New (this=0x8335d88) at editormanager.cpp:689
...
643 wxString key(name);
644 TiXmlElement* e = AssertPath(key);
645
646 TiXmlHandle parentHandle(e);
647 TiXmlText *t = (TiXmlText *) parentHandle.FirstChild(_C(key)).FirstC hild("str").FirstChild().Node();
648
(gdb) p name
$2 = (const wxString &) @0xbfca024c: {<wxStringBase> = {
static npos = 4294967295,
m_pchData = 0x8c7ad5c "/default_code/7"}, <No data fields>}
Yup, the offender is in 688:
key.Printf(_T("/default_code/%d"), (int)FileTypeOf(ed->GetFilename()));
Unluckily does not work :(
#include <stdio.h>
void func(const char* x = __FUNCTION__);
int main()
{
func();
return 0;
}
void func(const char *x)
{
printf("called from %s", x);
}
called from
Press ENTER to continue.
#include <stdio.h>
void func(int x = __LINE__);
int main()
{
func();
return 0;
}
void func(int x)
{
printf("called from %d", x);
}
called from 3
Press ENTER to continue.
Not what we need.
Unluckily does not work :(
Maybe I misremembered then, that or there's a bug in gcc.
Well, if the function has a unique name you could use an ugly :? wrapper macro to add the extra arguments:
#include <stdio.h>
void func(const char* x)
{
printf("called from %s", x);
}
#define func() func(__FUNCTION__)
int main()
{
func();
return 0;
}
which works, but as mentioned you better hope no client code uses other functions/classes/variables with the same name.