Bug Report !
Kiran-Krishna-Nadgir
c9913018@ncb.ernet.in
Mon May 8 02:07:00 GMT 2000
HI !,
i am sorry for the small mistake actually it gave an ICE
while i was compiling the program.
On 8 May 2000, Alexandre Oliva wrote:
> On May 7, 2000, Kiran-Krishna-Nadgir <c9913018@ncb.ernet.in> wrote:
>
> > i ran the following program and got an internal compiler error.
>
> > char* const ptr = "Its me";
> > *ptr = 'i';
>
> Do you mean you got a `Segmentation Fault'? You can't get an ICE
> while you *run* a program, only while you compile it.
>
> Your code assumes string literals are modifiable, but the ISO C
> Standard says they shouldn't be assumed to be. GCC stores them in
> read-only sections, so attempts to modify them cause the error you
> observe. See -fwritable-strings.
>
> --
> Alexandre Oliva Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
> Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
> Free Software Developer and Evangelist CS PhD student at IC-Unicamp
> oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me
>
>
*****************************************************************************
*****************************************************************************
More information about the Gcc-bugs
mailing list