ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/04/23/06:07:15

From: duperval AT ERE DOT UMontreal DOT CA (Duperval Laurent)
Subject: Exception 13 error
To: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List)
Date: Thu, 23 Apr 92 5:01:53 EDT
Status: O

Hi, it's me again :-)
 
But this time, I think I may have stumbled onto something.  The following
code gives me a run-time Exception 13 error.
 
enum MatType
{
  NonInitialise = 0,
  Quelconque,
  Symetrique,
  Diagonale,
  Identite,
};
 
#ifdef __GNUC__
enum MatTypI
{
  Point,
  Ligne,
  Triangle,
};
#endif
 
 
// Classe matrice
 
class Matrice
{
  private:
  Elem *Mat;
 
  int  Pos(int ligne, int col);
  Elem Rand(Elem Max);
  void Erreur(char *Msg);
  void LireTout(Matrice&);
 
  public:
  MatType Type;
 
#ifdef __GNUC__
  MatTypI TypI;
#endif
 
  int Ligne1;
  int Col2;
 
     [ member functions declarations ]
 
};
 
 
If I remove the lines between the #ifdef's, I get the exception error.  If
not, the program works fine.  But here's the catch:  THOSE LINES ARE USELESS.
They are declared but NEVER USED anywhere in the program.  Absolutely,
positively.  If I was on a 68k machine, I'd say the adresses of the member
functions are misaligned (odd addresses) and that would give me a segmentation
fault.  But, insofar as I know, the 80x86 family should have no problem
accessing anything whether it's aligned on an odd or even address.
 
My guess is that GO32 (sorry DJ) tries to run with every variable and func-
tion aligned on a quadword (4-byte) boundary and in this particular case,
that's not how it is compiled (assuming enums are treated as ints, adding
the patch gives 16 bytes of data instead of 14.  Elem is declared as
double).  I can't say for sure since I haven't looked at the code.
 
Anyone care to comment?

ObConfig:
486DX-33
4MB RAM
QEMM 6.0
DR-DOS 6.0 running 4DOS 4.0
SUPERPCK (disk cache)

If anyone deems it necessary, I can send a copy of my autoexec and config
 
P.S.  By the way, where do I get a list of run-time, compile-time, etc.
errors?
-- 
Laurent Duperval
duperval AT ere DOT umontreal DOT ca
duperval AT jsp DOT umontreal DOT ca

- Raw text -


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