Re: [Lxr-dev] [ lxr-Bugs-519945 ] definitions are also references
Brought to you by:
ajlittoz
From: Malcolm B. <ma...@br...> - 2002-02-20 03:22:15
|
Hi, I'd like to move the discussion on this to the developer list rather than the horrible SF interface. In fact I'd rather most bug discussion etc was done here if that's OK with people. no...@so... wrote: >Initial Comment: >LXR 0.9.1 [as well as older versions] shows definition >also in the list of references. > >eg consider a file test.c >--- >#define TEST 1 >-- > >Searching for "TEST" will show that it is >1. a macro defined at line 1, file test.c and >2. referenced in test.c at line 1 > 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. >If the number of definitions is small, this is OK. But >when the number of definitions is large, finding which >of the references are actually references becomes a >pain. > Umm, why would a symbol be being defined many times? Most programming languages don't allow you to define a symbol multiple times. >The easiest solution for this would be to remove all >definitions from the references list. > >If this is acceptable, I have a patch ready [the >backend is MySQL] > Personally I'm against this change, but what do others think? Malcolm |