public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/7414: GCC 3.1 gens bad pointer arithmetic? SIGSEGV
@ 2002-07-26 8:26 blackkm
0 siblings, 0 replies; 2+ messages in thread
From: blackkm @ 2002-07-26 8:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 7414
>Category: c
>Synopsis: GCC 3.1 gens bad pointer arithmetic? SIGSEGV
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Jul 26 08:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: K Black
>Release: gcc version 3.1
>Organization:
>Environment:
Windows XP Home, Cygwin
>Description:
code appears to compile with no errors and no warnings.
But always produces SIGSEGV at run time
>How-To-Repeat:
Line 10 (/* fails here */) appears to always fail with a segmentation fault (SIGSEGV?)?
char *t[3]={
"\0one",
"\0two",
"zzz"};
main() {
printf("t[1] before: %s\n",t[1]);
t[1][0]=' '; /* fails here */
printf("t[1] afterwords: %s\n",t[1]);
}
>Fix:
unknown - tried several variations on pointers and arrays
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c/7414: GCC 3.1 gens bad pointer arithmetic? SIGSEGV
@ 2002-07-26 18:27 cgf
0 siblings, 0 replies; 2+ messages in thread
From: cgf @ 2002-07-26 18:27 UTC (permalink / raw)
To: blackkm, gcc-bugs, gcc-prs, nobody
Synopsis: GCC 3.1 gens bad pointer arithmetic? SIGSEGV
State-Changed-From-To: open->closed
State-Changed-By: cgf
State-Changed-When: Fri Jul 26 18:27:05 2002
State-Changed-Why:
gcc places strings in read-only sections, by default.
Use gcc -fwritable-strings to override this.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7414
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-07-27 1:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-26 8:26 c/7414: GCC 3.1 gens bad pointer arithmetic? SIGSEGV blackkm
2002-07-26 18:27 cgf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).