Ok...
As far as I can see there seem to be 2 issues over here causing a runtime Access Violation error in PellesC 6RC2.
The first one:
void main()
{
double atest[5][5];
atest[4][4]=10; // <- here the program crashes
}
This one can be avoided by disabling the compiler optimations.
The second one:
typedef struct K_REGEL
{
int jaarkosten[10];
} K_REGEL;
void main()
{
K_REGEL rekenblad;
K_REGEL * tptr;
tptr=&rekenblad;
int i;
for(i=0;i<10;++i)
rekenblad.jaarkosten[i]=0;
tptr->jaarkosten[1]=(int)(tptr->jaarkosten[0]*3.25+0.5); // <- here the program crashes
}
This one can be avoided by enabling "microsoft extensions".
I hope Pelle is reading this and can shine his light on both issues.
Here's some good and some bad news...
Both samples (as far I could check) now both compile to a working executable in PellesC 6RC3. So it seems that Pelle managed to find and fix the problems regarding the code examples I posted.
The bad news is that my project still crashes with an Access Violation error. Workaround is enabling "Microsoft extensions".
There seems to be something going wrong with some combination of pointers, structures, arrays and float-to-int (or double-to-int) conversions in my project, causing Access Violation errors.
- No problems in PellesC 5
- No problems in other compilers (for example code::blocks)
- No problems in PellesC 6RC3 when enabling Microsoft Extensions
My full project is too big to post it here... I'm not sure if I can extract the essential code to reproduce the error.
Getting a bit desperate..