home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / gcc / bug / 3229 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.2 KB  |  43 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!iro.umontreal.CA!cote
  2. From: cote@iro.umontreal.CA (Marcel Cote)
  3. Newsgroups: gnu.gcc.bug
  4. Subject: BUG
  5. Date: 22 Jan 1993 21:08:05 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 30
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-gcc@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <9301220221.AA24028@carre.iro.umontreal.ca>
  12.  
  13. To whom it may concern,
  14.  
  15.     This letter is to ask if you have any information concerning a discrepancy
  16. I found while preparing data for a course.  The machine I was working on was a 
  17. Sparc II with the operating system SunOS release 4.1.3.  There are no problems for 
  18. compiling but at execution there is a segmentation fault.  The version of the 
  19. compiler was gcc 2.3.3.  The fault line is indicated below.  If you omit the      
  20. incrementation operator, the problem is corrected.  If I'm correct the syntax
  21. is not faulty, even your debugger will permit to display the result. 
  22.  
  23.  
  24. struct S1 {
  25.    char *s;
  26.    int i;
  27.    struct S1 *s1p;
  28. };
  29.  
  30. main()
  31. {
  32.    static struct S1 a[] = {
  33.       { "abcd", 1, a+1 },
  34.       { "efgh", 2, a+2 },
  35.       { "ijkl", 3, a }
  36.    };
  37.    
  38.    printf("%c\n",++a[0].s[3]);
  39. }
  40.  
  41.  
  42.  
  43.