Tool/software: TI C/C++ Compiler
Hello,
I have some problem with a missing error the compiler shall issue.
We are using CGT version 7.4.23 with CCS 8.1.0.11 on a C6418.
When I was debugging I found out that a constructor of an class is called where no instances should exist.
The class was defined like this
in .h file:
class A
{
static A _instances[];
}
in .cpp file:
A A:_instances[APP_DEFINE_A_INSTANCE_CNT];
For the application I was compiling APP_DEFINE_A_INSTANCE_CNT was set to 0.
Inside of the constructor only member vars were set.
Before main() is reached all static objects are initialized. Therefore the constructor was called. But since no instance was existing, it was overwriting some other data.
What is the reason I don't get the compiler error?
Is it a wrong CGT configuration?
I also tested:
int a[0];
But this is compiled without error, too.
I need your help. I expect to get a compiler error. Is this assumption wrong?
Thank you for your help!
Kind Regards
Bernhard Seiz
