This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Bug or feature: symbol names of global/extern variables
- From: Wolfgang Roemer <w dot r dot a dot roemer at t-online dot de>
- To: Michael Veksler <VEKSLER at il dot ibm dot com>
- Cc: binutils at sources dot redhat dot com,Robert Dewar <dewar at adacore dot com>,gcc at gnu dot org
- Date: Thu, 6 Oct 2005 16:02:37 +0200
- Subject: Re: Bug or feature: symbol names of global/extern variables
- References: <OF74043FCF.FE1E0519-ON43257092.004AC4F6-43257092.004C6E25@il.ibm.com>
Hello Michael,
On Thu Oct 06, 2005 15:54, Michael Veksler wrote:
[..]
>> 2. I think that it will break C. As I remember, it is sometimes
>> legal in C (or in some dialects of C) to have conflicting types.
>> You may define in one translation unit:
>> char var[5];
>> and then go on and define in a different translation unit:
>> char var[10];
>> The linker will merge both declarations and allocate at least
>> 10 bytes for 'var' (ld's --warn-common will detect this).
that is interesting: If the linker would behave that way, I wouldn't get the
error because the needed 8 bytes for a double would be allocated.
WR