Hi,

I've found a few more or less strange compiler bugs...

The first one is triggered whenever the first use of the operator new in a compilation unit is new[]. Try e.g. adding

Code:
static void foo() {
        int *i = new int[42];
}
somewhere in the beginning of a file (the function doesn't need to be called ever). Compiling this project and linking it, yields this linker warning:

mwldsym2.exe: warning: Multiply defined symbol: void * operator new(unsigned int) (??2@YAPAXI@Z) in
mwldsym2.exe: warning: files New.cpp.obj (MSL_All_MSE_Symbian.lib), UP_DLL.obj (EDLL.LIB),
mwldsym2.exe: warning: keeping definition in UP_DLL.obj
mwldsym2.exe: warning: Multiply defined symbol: void operator delete(void *) (??3@YAXPAX@Z) in
mwldsym2.exe: warning: files New.cpp.obj (MSL_All_MSE_Symbian.lib), UP_DLL.obj (EDLL.LIB),
mwldsym2.exe: warning: keeping definition in UP_DLL.obj

The workaround in this case is simple, add a similar dummy function containing "int *i = new int();" at the top of files exhibiting this problem.

This is tested with the CW compiler bundled with Carbide.c++ (although only used from commandline). This happens regardless of which SDK is used.


The other bug happens when linking with estlib.lib, on S60 3.0, and a leave is trapped somewhere. Try adding this code somewhere in a project (the helloworld example works fine):

Code:
static void FuncL() {
        User::Leave(42);
}
And make sure it is called sometime:
Code:
LOCAL_C CApaApplication* NewApplication()
        {
        TRAPD(err, FuncL());
        return new CHelloWorldBasicApplication;
        }
Add estlib.lib to the mmp file, compile and run. When exiting the program, a dialog saying "App. closed: HelloWorld" is displayed and the error log contains "Thread HelloWorld::HelloWorld Panic ALLOC: 1e6b3fe8".

I haven't found any real workaround for this, any program containing leaves look like they leak memory...

// Martin