public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* other/5563: using a pointer named "end" consistently produces segfault in windows.
@ 2002-01-31 21:06 arlankfo
  0 siblings, 0 replies; only message in thread
From: arlankfo @ 2002-01-31 21:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5563
>Category:       other
>Synopsis:       using a pointer named "end" consistently produces segfault in windows.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 31 21:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Lankford
>Release:        gcc-2.95.3 (cygwin and mingw)
>Organization:
>Environment:
Windows 98
>Description:
The following terse (and useless) will compile and link fine,
but the executable crashes immediately:

--------------snip--------------
char mystring[]="hello";
char *end;
int main() {
  end=mystring;
  return 0;
}
--------------snip--------------

I first noticed this problem with another program
I wrote that created a pointer to a structure named "end".
I renamed it to "cend" and the program works fine now.
The Free/NetBSD versions of gcc don't have this problem.
The crash seems to occur any time you use "end" with the assignment operator.
>How-To-Repeat:
compile and attempt to run this program in a Windows environment.
>Fix:
rename any variables named "end"
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"

Y2hhciBteXN0cmluZ1tdPSJoZWxsbyI7CmNoYXIgKmVuZDsKaW50IG1haW4gKCkgewogIGVuZD1t
eXN0cmluZzsKICByZXR1cm4gMDsKfQo=


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-01  5:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-31 21:06 other/5563: using a pointer named "end" consistently produces segfault in windows arlankfo

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).