Date: Sun, 4 Oct 1998 13:42:54 -0400 (EDT) Message-Id: <199810041742.NAA01799@indy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (spam@somebody.else) Subject: Re: SIGSEGV under DOS, but not Win9x? > int VGANewBitmap(BITMAP *bmp,int W,int H) > { > bmp->Data = (byte *)malloc(W*H); > I get an immediate segfault if I use the declarations: > BITMAP *bitmap; > VGANewBitmap(bitmap,256,240); You are declaring a pointer (bitmap) and passing it to a function (which dereferences it) but you never initialize the pointer to point to anything. If the undefined initial value happens to be zero, your program will crash. > This happens only under DOS+cwsdpmi, but not under Win9x. cwsdpmi is a lot stricter than Windows; if you have a problem in cwsdpmi and not windows, it's probably a bug in your code.