This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Legal c program Segv's


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]