www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/21/04:37:22

From: byrne AT katie DOT vnet DOT net (Paul Byrne)
Newsgroups: comp.os.msdos.djgpp
Subject: a rather strange error with global variables...
Organization: Vnet Internet Access, Inc. - Charlotte, NC. (704) 374-0779
Lines: 28
Message-ID: <70k64a$gu$1@katie.vnet.net>
Date: 21 Oct 1998 04:31:06 -0400
NNTP-Posting-Host: 166.82.1.7
X-Trace: ralph.vnet.net 908958668 166.82.1.7 (Wed, 21 Oct 1998 04:31:08 EDT)
NNTP-Posting-Date: Wed, 21 Oct 1998 04:31:08 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've been getting some unusual errors with a program I'm writing.  I was
writing temporary code to help test some new classes.  I included the
following global variables:

char m[256][256];
int v[256][256];
int t[256][256];
int e[256][256];

and everything worked fine.  However, simply changing the order to

int e[256][256];
char m[256][256];
int v[256][256];
int t[256][256];

causes problems.  Everything compiles fine.  Running produces a SIGSEGV.
Further playing with the order produces a range of ugly errors.  In some
cases (under win95) the program kills the dos box and gives a dialog
box telling you to restart the machine (if you ignore this and run it again
it reboots the machine for you).  In another case, the program spewed
garbage to the screen (graphics, under allegro) and locked up the machine.
Running under dos (without the win95) didn't make any difference.

Is there some subtlety I'm missing here?

Thanks,
-paul

- Raw text -


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