K
Kris Garrett
On AIX-4.3.3 using xlc v5.0, I observe the following madness:
int
main(int argc, char *argv[])
{
char ifxsrv[64];
ProcConfig config;
FSINFO fs_array[NUM_FS];
SYSCFG util;
int rc = 0;
[..snipped..]
return 0;
}
Results in "Illegal instruction(coredump)" upon exiting (via return 0).
The program does run to completion, but looks as if it somehow returns
to a non-valid address. The wired part is that if the above code is
changed to:
int
main(int argc, char *argv[])
{
ProcConfig config;
FSINFO fs_array[NUM_FS];
SYSCFG util;
int rc = 0;
char ifxsrv[64];
[..snipped..]
return 0;
}
The program runs to completion without coredumping on an illegal
instruction.
FSINFO, SYSCGF, and ProcConfig are defined in a separate header file.
My question is why would the order of declarations effect the stability
of an executable? Non-deterministic behavior == a bad day.
int
main(int argc, char *argv[])
{
char ifxsrv[64];
ProcConfig config;
FSINFO fs_array[NUM_FS];
SYSCFG util;
int rc = 0;
[..snipped..]
return 0;
}
Results in "Illegal instruction(coredump)" upon exiting (via return 0).
The program does run to completion, but looks as if it somehow returns
to a non-valid address. The wired part is that if the above code is
changed to:
int
main(int argc, char *argv[])
{
ProcConfig config;
FSINFO fs_array[NUM_FS];
SYSCFG util;
int rc = 0;
char ifxsrv[64];
[..snipped..]
return 0;
}
The program runs to completion without coredumping on an illegal
instruction.
FSINFO, SYSCGF, and ProcConfig are defined in a separate header file.
My question is why would the order of declarations effect the stability
of an executable? Non-deterministic behavior == a bad day.