[Bug c/64187] Writing to a char array cast from a char * causes a segmentation fault
brian.corriveau at ericsson dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 4 22:03:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64187
--- Comment #3 from Brian <brian.corriveau at ericsson dot com> ---
Thanks for the speedy reply. I just added a comment on the bug. Maybe
-Wall should catch this kind of thing?
thanks again
brian
pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64187
>
> Andrew Pinski <pinskia at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED |RESOLVED
> Resolution|--- |INVALID
>
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> char *test = "this is a test";
>
>
> This is a string literal so it stored in constant memory and which is why you
> are getting a segfault.
>
>
More information about the Gcc-bugs
mailing list