This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: gcc -mno-cygwin foo.c & gcc foo.c generate different behavior
- From: "Alex Vinokur" <alexvn at connect dot to>
- To: cygwin at cygwin dot com
- Date: Tue, 22 Jun 2004 19:10:34 +0300
- Subject: Re: gcc -mno-cygwin foo.c & gcc foo.c generate different behavior
- References: <cb9lec$ueu$1@sea.gmane.org>
"Alex Vinokur" <alexvn@connect.to> wrote in message cb9lec$ueu$1@sea.gmane.org">news:cb9lec$ueu$1@sea.gmane.org...
> ====================
> Windows 2000
> CYGWIN_NT-5.0 1.5.10-3 (0.116/4/2)
> gcc (GCC) 3.3.1 (cygming special)
> ====================
>
>
>
> ------ foo.c ------
>
> #include <stdio.h>
>
> struct foo
> {
> char* bar_;
> };
>
> int main()
> {
> char* ch = "ABC";
--------------------------
> struct foo* f;
f is not initialized
--------------------------
>
> f->bar_ = ch; /* gcc foo.c : Segmentation fault */
> printf("start\n");
> printf("---> %s\n", f->bar_);
> printf("finish\n");
>
> return 0;
>
> }
>
[snip]
--
Alex Vinokur
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/