Menu

#90 "Cannot open file" error on erroneously added directory for incfile.

None
closed-accepted
nobody
None
5
2018-08-23
2018-08-22
No

incfile() adds a directory to srcfiles[] causing an annoying error during scanning.
This happens when there is an include directory with a matching name of an "#include":

~/target/usr/include/dir/dir.h

and a C++ file like this:
...
#include <dir>
...

1 Attachments

Discussion

  • Hans-Bernhard Broeker

    • labels: incfile -->
    • status: open --> closed-accepted
    • Group: -->
     
  • Hans-Bernhard Broeker

    Patch looks good.

    But just in case, please note that even with the patch, cscope would not find that header dir.h while looking for <dir>

     
  • mikhail nefedov

    mikhail nefedov - 2018-08-23

    Thanks. Understood about not opening the dir.h
    BTW would it be sensible to move the checking for regular files into the addsrcfile()?

     
    • Hans-Bernhard Broeker

      No, that wouldn't be truly sensible. addsrcfile() has a well-defined job, as given by its name: add something to srcfiles. Doing more in there would be somewhat wastefule, e.g. in the cases where it's called on reading the current database, i.e. with pathnames that have already been vetted the previous time round.

       
  • mikhail nefedov

    mikhail nefedov - 2018-08-23

    Got it!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.