#30 Building cross-reference file fails on some filesystems

closed
nobody
None
5
2011-07-03
2010-10-26
Miles Strombach
No

The lstat call (accessible_file in dir.c) made when building the cross-ref db fails when accessing a file on an FS that uses 64-bit inodes, most commonly CIFS. Building the package with CFLAGS=-D_FILE_OFFSET_BITS=64 (per 'man 2 stat', see EOVERFLOW) fixes this problem. This addition causes no problems for 32-bit-inode FSes, so it should probably be added to the default CFLAGS.

Discussion

  • Adding a new-fangled, system-specific flag like that to a portable package's default CFLAGS would be utter folly.

    Note that what you see as "man 2 stat" my very well have little or no relation at all to what happens on other platforms --- or even different versions/installations of the same platform, for that matter.

     
  • That CFLAG just sets a define that is part of the Large File Support extension to the Single UNIX Specification (http://www.unix.org/version2/whatsnew/lfs20mar.html) which has been around since 1996. Even if it was new and system specific, as a it's just define it wouldn't change any behavior on systems that don't check for it.

    Using the AC_SYS_LARGEFILE macro in configure.in should do the right thing (see http://www.gnu.org/s/hello/manual/autoconf/System-Services.html\) in the rare event that cscope is being compiled on a system without large file support.

     
    • status: open --> closed