Legal c program Segv's
Ed Connell
Ed.Connell@sas.com
Mon Jun 19 12:31:00 GMT 2000
The following program SEGV's immediately when compiled with -shared. (When compiled without -shared it is an infinite loop which is apparently correct (although counterintuitive)) You can't run it in gdb at all. This happens on the 000614 image as well as older ones.
Should you need to contact me, please email me directly...I am not on the mailing list.
Thanks
Ed Connell
gcc toy.c -g -o toy_segv -shared
toy.c
*********************
enum
{
doc_root_dir,
doc_sys_dir,
doc_systitle_dir,
doc_title_dir,
doc_data_dir,
doc_bygroup_dir,
doc_page_dir,
doc_obj_dir,
DOC_NUM_DIRS
};
int main() {
int i;
for (i=doc_obj_dir; i >= doc_root_dir; i--) {
printf("%d\n", i);
}
return 0;
}
More information about the Gcc-bugs
mailing list