Re: Include not working on samba share

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12:17 09.01.2009 +0100, Fabian Cenedese wrote:
>At 15:27 05.01.2009 +0100, Fabian Cenedese wrote:
>>We have some projects that are C++ with header files and can be compiled
>>with no problems on a local drive. The used gcc is quite old (2.96.x) and
>>built with cygwin, running on windows.
>>
>>However if the whole project is moved from the local drive to a share
>>(samba, probably also windows) the compilation may fail with
>>various errors. The main problem seems to be that include files are not
>>read properly. They are found (gcc emits an error if the name is wrong)
>>but the content seems not to be read. Even if such a problematic
>>header file contains crap it is not mentioned by gcc. To make things
>>worse is that on different computers the compilation may fail differently
>>or even work without problems.
>
>I have now tried gcc 3.4.3 and 4.1 with the same cygwin1.dll (1.5).
>They both can compile the project without showing these errors. Does
>anyone know what could have changed regarding file opening/reading
>since 2.x or whereabout to look at?

I'm reviving this old thread in case somebody is looking for a solution.

cpp.exe has a mechanism to ensure that the same file will not be included
multiple times. It identifies "the same file" by remembering the device-id
and inode-number of each already included file. Unfortunately, when the
above problem happens, the inode numbers of different files are equal!
That's why cpp.exe did just not include the second file and also didn't
report any error...

The issue about the non-unique inode numbers is described here:
http://www.cygwin.com/cygwin-ug-net/highlights.html

"On file systems which don't support unique persistent file IDs (FAT, older Samba shares) the inode number for a file is calculated by hashing its full Win32 path. The inode number generated by the stat call always matches the one returned in d_ino of the dirent structure. It is worth noting that the number produced by this method is not guaranteed to be unique. However, we have not found this to be a significant problem because of the low probability of generating a duplicate inode number."

As gcc 3 and 4 don't have this problem they may do additional or
different checks to not include a file twice.

bye  Fabi


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux