Article View: gnu.gcc.bug
Article #1638BUG
From: Marcel Cote
Date: Sat, 23 Jan 1993 02:08
Date: Sat, 23 Jan 1993 02:08
27 lines
1235 bytes
1235 bytes
To whom it may concern,
This letter is to ask if you have any information concerning a discrepancy
I found while preparing data for a course. The machine I was working on was a
Sparc II with the operating system SunOS release 4.1.3. There are no problems for
compiling but at execution there is a segmentation fault. The version of the
compiler was gcc 2.3.3. The fault line is indicated below. If you omit the
incrementation operator, the problem is corrected. If I'm correct the syntax
is not faulty, even your debugger will permit to display the result.
struct S1 {
char *s;
int i;
struct S1 *s1p;
};
main()
{
static struct S1 a[] = {
{ "abcd", 1, a+1 },
{ "efgh", 2, a+2 },
{ "ijkl", 3, a }
};
printf("%c\n",++a[0].s[3]);
}
Technical Details
Message-ID:
<9301220221.AA24028@carre.iro.umontreal.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!iro.umontreal.CA!coteShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!iro.umontreal.CA!cote From: cote@iro.umontreal.CA (Marcel Cote) Newsgroups: gnu.gcc.bug Subject: BUG Date: 22 Jan 1993 21:08:05 -0500 Organization: GNUs Not Usenet Lines: 30 Sender: daemon@cis.ohio-state.edu Approved: bug-gcc@prep.ai.mit.edu Distribution: gnu Message-ID: <9301220221.AA24028@carre.iro.umontreal.ca>