Hans-Bernhard Broeker wrote:
> On Sun, 3 Oct 2004, Neil Horman wrote:
>
>
>>It effectively ensure that if a file is a link, that it points
>>to a readable file before it adds it to the search list.
>
>
> I don't see how this could have any effect, given that the struct stat
> you're checking was obtained by lstat(), not stat(). I don't think
> S_ISLNK() can ever be true in that case, can it?
>
> Also note that this patch may be rendered unnecessary by the changes to
> issrcfile() already in cscope CVS.
>
Hans-
I checked cvs for cscope changes that may have repaired this problem,
but unfortunately the problem persists there. I don't have it 100%
sorted out, but I'm fairly confident that this bug is stemming from a
discrepancy between the source file list (srcfiles) and the database
file. In the crossref function, it would appear that every file which
is in the source file list, gets an entry in the cscope database which
at a minimum consists of its filename, two newlines and a tab. This
minimal entry is not added to the database, however, in the event that
the file is unreadable (not a regular file, a link that points to a
non-existant file, etc). This descrepancy seems to skew the database
file index, which confuses cscope into thinking symbols are
used/defined/etc in files which they are not. I think the solution to
this should be either prevent non-readable files from being added to the
source file list (a generalization on my previously proposed patch), or
a change which forces crossref() to add the aformentioned minimal entry
to the database for every file in srcfiles. The attached patch
implements the latter idea.
Thoughts and comments appreciate. Thanks!
Neil
--
/***************************************************
*Neil Horman
*Software Engineer
*Red Hat, Inc.
*nhorman@...
*gpg keyid: 1024D / 0x92A74FA1
*http://pgp.mit.edu
***************************************************/
|