delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/02/03:31:18

From: Paul Shirley <Paul AT no DOT spam DOT please>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Excessive exe sizes
Date: Tue, 2 Dec 1997 03:34:59 +0000
Organization: wot? me?
Lines: 21
Distribution: world
Message-ID: <JOjIiHAjH4g0EwIF@foobar.co.uk>
References: <97Nov25.163503gmt+0100 DOT 17026 AT internet01 DOT amc DOT de>
<Pine DOT SUN DOT 3 DOT 91 DOT 971125174221 DOT 28212Q-100000 AT is>
Reply-To: Paul Shirley <Paul AT chocolat DOT obvious DOT fake DOT foobar DOT co DOT uk>
NNTP-Posting-Host: chocolat.foobar.co.uk
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <Pine DOT SUN DOT 3 DOT 91 DOT 971125174221 DOT 28212Q-100000 AT is>, Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> writes
>> does any other C++ compiler have this problem?
>
>I have no idea.  I try to stay away of C++ as much as I can.  Maybe other 
>compilers just let you fail if you define the same object twice?

In C++ multiple global instances of the same variable is an error, even
if they match in type and size. gxx and VC4 both trap this at link time.

On VC4 I'm seeing an 18K .exe containing 'int a[1000000];' so it looks
like this goes into BSS OK on VC4.

Looks like a gcc misfeature.

So the question becomes: why does gxx really not put them into BSS? The
destructor argument makes no sense since its illegal to merge variable
instances this way, so multiple destructors *cannot* exist.

---
Paul Shirley: my email address is 'obvious'ly anti-spammed

- Raw text -


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