🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53277

Are these bugs in GCC2.0?

#53277
From: John Ngai
Date: Tue, 25 Feb 1992 04:28
42 lines
1610 bytes
I used GCC 2.0 to recompile some of my existing code, and seem to find
the following "bugs":

(1) Redefining/Overloading the global ::operator new(size_t) doesn't work?
    (Interestingly, GCC 2.0 allows me to get around this by redefining 
     the internal function ::__builtin_new(size_t))

(2) Initialization of global static objects with constructors doesn't seem
    to call their corresponding constructors, eg:

    class AtomTable
    {
	....
        int table_size;

      public:
 	AtomTable(int init_size);
    };

    AtomTable::AtomTable(int init_size) 
    {
	...
	table_size = init_size;
    }

    AtomTable table(1024);

    main()
    {
	...
        table.insert(word);
    }

    Among other things, I got an arithmetic exception in calling insert 
    because of a division by zero in my internal hash function, which depends 
    on having table_size initialized correctly. Checking with a debugger
    reveals that the constructor never gets called. 

-- John


    
Technical Details
Message-ID: <1992Feb25.042832.28928@walter.bellcore.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!mips!dimacs.rutgers.edu!rutgers!bellcore!walter!apostle!ngai

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,503a0bf4dd3425e2,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-02-24 21:31:32 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!mips!dimacs.rutgers.edu!rutgers!bellcore!walter!apostle!ngai
From: ngai@apostle.bellcore.com (John Ngai)
Newsgroups: gnu.gcc.help
Subject: Are these bugs in GCC2.0?
Message-ID: <1992Feb25.042832.28928@walter.bellcore.com>
Date: 25 Feb 92 04:28:32 GMT
Sender: ngai@apostle (John Ngai 21371)
Organization: Bellcore
Lines: 42
Nntp-Posting-Host: apostle.bellcore.com