This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug or feature: symbol names of global/extern variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]