From: Shree K. <sh...@pr...> - 2002-02-20 05:52:21
|
Hi Malcolm, > I think this is correct - the symbol is referenced at line 1, it just > happens that this reference is a definition. Remember, the lxr doesn't > attempt to do full parsing of the source (deliberately at the moment), > so references simply means that the string "TEST" occurs here and looks > like it might be a symbol. > Right, but when you say "reference", most people tend to think that the symbol is being "used" in some way at that line [maybe as an assignment]. It's highly unlikely that anyone would write code like void func() { } void test { func() } > Umm, why would a symbol be being defined many times? Most programming > languages don't allow you to define a symbol multiple times. > One for the fn prototype, one for the fn declaration [think of this over 2 or 3 different platforms]. I've seen the problem becoming acute, particularly with #defines. And it is difficult to filter out the definitions from the references list, when there are too many "definition"s. In a source tree, a symbol being defined many times is a distinct possiblility [I have struggled with this problem before]. Not everything in a source tree might be linked into one. > Personally I'm against this change, but what do others think? Here's one reason that I wanted this change: I've run into situations where we'd like to know where the variable is being initialized, changed, etc. and it is so frustrating to jump to a reference and find out that it is not really a "reference". - Shree Kumar |