Bug or feature: symbol names of global/extern variables

Wolfgang Roemer w.r.a.roemer@t-online.de
Thu Oct 6 14:02:00 GMT 2005


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



More information about the Binutils mailing list