delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/22/06:16:10

From: D DOT J DOT Eleveld AT anest DOT azg DOT nl
Newsgroups: comp.os.msdos.djgpp
Subject: How can I tell if it's a bug from DJGPP or GCC?
Date: Tue, 22 Sep 1998 10:04:05 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 95
Message-ID: <6u7smk$9t7$1@nnrp1.dejanews.com>
NNTP-Posting-Host: 192.87.23.66
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello Everyone,

I may have found some bugs in DJGPP but I am unsure if I should report them
at http://www.delorie.com/djgpp/bugs/ since it asks for only DJGPP bugs and
not GCC bugs.  Now since DJGPP is a dos port of GCC how am I supposed to find
out if a problem comes from the DJGPP part or the GCC part?

Thanks,

Doug Eleveld

In any case here are two files that show the (possible) bugs:

---bug1.cc---
/* BUG: The calling of destructors for (class) statically declared classes
   is done in global scope and not class scope like it should. */

class singelton
{
 private:
   singelton() { };
   ~singelton() { };

 public:
   static singelton instance;
};

singelton singelton::instance;

/*
I get these errors:

bug1.cc:12: warning: all member functions in class `singelton' are private
bug1.cc:12: warning: `class singelton' only defines a private destructor and
has no friends bug1.cc: In function `(static destructors for bug1.cc)':
bug1.cc:8: `singelton::~singelton()' is private bug1.cc:33: within this
context

Small problem:
The warning about all member functions being private and the class having no
friends is not useful when there are static instances of the class.

Bug:
The static singleton is within the scope of class and should be able to be
destructed, but DJGPP is trying to destroy it at global scope.
*/

---bug2.cc---
/* BUG: Constant enum's arent always handled correctly */

#include <stdio.h>

enum index { zero = 0,
             one,
             two,
             three,
             four
           };

index GetVariable()
{
  return zero;
}

/* This assignment seems to be being skipped */
const index problem = GetVariable();

void Test(index event)
{
  switch(event)
  {
    /* Error occurs here */
    case problem:
      break;
    default:
  }

}

/*
I get these errors:

bug2.cc: In function `void Test(enum index)':
bug2.cc:25: case label `problem' does not reduce to an integer constant
bug2.cc:27: warning: unreachable code at beginning of switch statement
bug2.cc:28: parse error before `}'

I'm declaring a enum that's const so that should be a number, and not
just treated like a define, as it appears to be doing here, otherwise
side effects aren't handled properly.

*/

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

- Raw text -


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