public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Fabian Cenedese <Cenedese@indel.ch>
To: gcc-help@gcc.gnu.org
Subject: Re: Include not working on samba share
Date: Wed, 17 Mar 2010 08:28:00 -0000	[thread overview]
Message-ID: <5.2.0.9.1.20100317084621.046a1ac8@localhost> (raw)
In-Reply-To: <5.2.0.9.1.20090109121534.01ebdd60@localhost>

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

      reply	other threads:[~2010-03-17  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 14:28 Fabian Cenedese
2009-01-09 11:18 ` Fabian Cenedese
2010-03-17  8:28   ` Fabian Cenedese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.2.0.9.1.20100317084621.046a1ac8@localhost \
    --to=cenedese@indel.ch \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).