This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Legal c program Segv's
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: Legal c program Segv's
- From: Ed Connell <Ed dot Connell at sas dot com>
- Date: Mon, 19 Jun 2000 15:31:06 -0400
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;
}