Mail Archives: djgpp/1996/05/19/11:44:18
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 -