Xref: news2.mv.net comp.os.msdos.djgpp:3998 From: dan AT dan DOT emsphone DOT com (Dan Nelson) Newsgroups: comp.os.msdos.djgpp Subject: Re: bugs in cwsdpmi? Date: 19 May 1996 02:01:36 GMT Organization: PSI Public Usenet Link Lines: 28 Message-ID: <4nlve0$s8s@client3.news.psi.net> References: <4nlke7$aka AT news1 DOT goodnet DOT com> NNTP-Posting-Host: 199.67.51.101 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp snarfy AT goodnet DOT com wrote: > Here is an interesting 'bug' that I have found in cwsdpmi. When I compile > the attached file and run it under dos, it blows up giving me a SIGSEGV, but > it works correctly under a windows dos box and in linux dosemu. Here > is the program: Then windows and dosemu are broken :) Where are you allocating the structure that bar points to? Bar's only the pointer, and since it's static, it's zeroed out. Your SIGSEGV is a null pointer violation. > > #include > > typedef struct { > int x; > int y; > } foo; > > foo *bar; > void main() > { > bar->x = 3; > bar->y = 4; > printf("x = %d\n", bar->x); > } -Dan Nelson dnelson AT emsphone DOT com