Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 4488 - Bug in egcs when compiling a 2-dimensional array access
Summary: Bug in egcs when compiling a 2-dimensional array access
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: egcs
Version: 6.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-08-12 02:10 UTC by rross
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-08-30 03:50:58 UTC


Attachments (Terms of Use)

Description rross 1999-08-12 02:10:17 UTC
When compiling a program with a 2 dimensional array, we get
"segmentation fault" when executing the program when
performing a string storage into a globally declared 2
dimentional array. This program compiles and executes
properly on AIX, SCO Unixware, SCO Open Server, AT&T Unix
V.4, and various releases of these systems. It also
compiles and works correctly on Caldera Linux Release 1.2.
I have a sample program that can be provided that exhibits
the problem. We need to resolve this problem so that we can
release our commercial software products (hopefully) on
Redhat Linux 6.0. I can be contacted via e-mail at
rross@magstarinc.com. I hope to hear from you soon.

Comment 1 rross 1999-08-12 02:19:59 UTC
I cannot seem to be able to send a attachment to provide a sample of
the code that exhibits the problem. If someone will e-mail me, I can
reply with an attachment showing an example of the problem.

Comment 2 Jeff Johnson 1999-08-12 14:46:59 UTC
Just reply to this message with test program included. Thanks.

Comment 3 Jim Kingdon 1999-08-30 03:50:59 UTC
The declaration "char *Words[]" declares Words to be an array of
pointers to char (note that it is not an array of arrays of char).
Therefore the strings in the initializer "            " are
string constants (and thus readonly), not an initialized array of
char (which would be read/write).  If you want more explanation,
go to comp.lang.c (or your favorite such source) - I realize that
I'm not really offering a full explanation here.

If you want to just get your code to work (without having to
fix it), supply the -fwritable-strings option to gcc.


Note You need to log in before you can comment on or make changes to this bug.