delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/19/11:44:18

Date: Mon, 20 May 1996 01:34:57 +1000
From: Robert Nader <naderr AT linuxbox DOT nse DOT com DOT au>
Message-Id: <199605191534.BAA01526@linuxbox.nse.com.au>
To: snarfy AT goodnet DOT com
CC: djgpp AT delorie DOT com
Subject: bugs in cwsdpmi?
In-Reply-To: <113212498@toto.iv>
Reply-To: naderr AT topaz DOT cqu DOT edu DOT au
Mime-Version: 1.0 (generated by tm-edit 7.61)

The thing that blows me away about msdos programmers is that a lot
of them have no idea what storage is about.

I have not a clue as to wether cwsdpmi is broken or not, but to define
a pointer, foo *bar; , and _not_ to give it any storage and then
go wack stuff in it is amazing that it works in msdos at all!
If anything is broken its whatver allows that sort of thing to run
without a runtime error.

Try that under UNIX and you'll get a lovely segmentation fault :)


snarfy AT goodnet DOT com writes:
 > 
 > 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:
 > 
 > #include <stdio.h>
 > 
 > typedef struct {
 > int x;
 > int y;
 > } foo;
 > 
 > foo *bar;
 > void main()
 > {
 >      bar->x = 3;
 >      bar->y = 4;
 >      printf("x = %d\n", bar->x);
 > }
 > 
 > 
 > As you can see, there isn't much to this program, and I have compiled
 > programs that are a lot more complex than this with the exact same
 > system setup with no problems.

 ;)

[ snip ]

 > Josh
 > snarfy AT goodnet DOT com
 > 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019