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

2005-10-06 Thread Mike Stump
On Oct 6, 2005, at 2:44 AM, Michael Veksler wrote: This is the wrong list for linker enhancements. You should look for binutils mailing lists. However "collect2" which is part of gcc and is called before the linker (for C++)- could also detect this and give the same warning. I would bet that coll

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

2005-10-06 Thread Robert Dewar
Michael Veksler wrote: Why do you think that this would be a mistake? (you in the above is dewar) Michael has exactly stated my reasons :-)

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

2005-10-06 Thread Jan Beulich
>>> Wolfgang Roemer <[EMAIL PROTECTED]> 06.10.05 16:02:37 >>> >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 transl

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

2005-10-06 Thread Wolfgang Roemer
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 the

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

2005-10-06 Thread Michael Veksler
Wolfgang Roemer wrote on 06/10/2005 16:14:03: > On Thu Oct 06, 2005 14:50, Robert Dewar wrote: > >> [..] > >> > >> I actually disagree with this, I think attempting to make the link fail > >> here would be a mistake. > > Why do you think that this would be a mistake? > I agree with Robert,

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

2005-10-06 Thread Wolfgang Roemer
On Thu Oct 06, 2005 14:50, Robert Dewar wrote: >> [..] >> >> I actually disagree with this, I think attempting to make the link fail >> here would be a mistake. Why do you think that this would be a mistake? WR

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

2005-10-06 Thread Robert Dewar
Wolfgang Roemer wrote: The main.o will perfectly link with the library although main.o needs a double variable named maximum and the lib only offers an int variable named maximum. Because the symbol name does in no way reflect the variable type, everything links fine but in fact the variable n

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

2005-10-06 Thread Robert Dewar
Wolfgang Roemer wrote: Hello, so it seems as if it would be best if I post that to the binutils mailing list. Agreed? Indeed. This is not a simple change, but it would make a nice well defined project for someone to work on! > It sounds as if the symbol is still "maximum" and it is annotate

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

2005-10-06 Thread Wolfgang Roemer
Hello, so it seems as if it would be best if I post that to the binutils mailing list. Agreed? WR On Thu Oct 06, 2005 11:57, Robert Dewar wrote: >> Michael Veksler wrote: >> > It sounds as if the symbol is still "maximum" and it is annotated with >> > its type (something like debug informati

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

2005-10-06 Thread Robert Dewar
Michael Veksler wrote: It sounds as if the symbol is still "maximum" and it is annotated with its type (something like debug information). I should be possible to hack the linker to emit a warning for symbols with conflicting debug information. Nice idea! This is the wrong list for linker en

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

2005-10-06 Thread Michael Veksler
Wolfgang Roemer wrote on 06/10/2005 12:03:39: > Hello Michael, > > first of all: Thanks for the fast reply! > > On Thu Oct 06, 2005 10:33, you wrote: > >> [..] > >> > >> It's a feature. It is undefined behavior to have conflicting declarations > >> in different translation units. > >> [...]

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

2005-10-06 Thread Wolfgang Roemer
Hello Michael, first of all: Thanks for the fast reply! On Thu Oct 06, 2005 10:33, you wrote: >> [..] >> >> It's a feature. It is undefined behavior to have conflicting declarations >> in different translation units. >> [...] Well, but shouldn't there at least be a warning during linking!? >

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

2005-10-06 Thread Michael Veksler
Wolfgang Roemer wrote on 06/10/2005 10:52:35: > > I don't know whether it is a bug or feature and I searched through the mailing > lists without success therefor I write my question this way: > > If you have a global variable inside a cpp file and create a library out of > that, the symbol name