<p dir="ltr">On 7 Jun 2016 7:52 a.m., "pierre gousseau" <<a href="mailto:pierregousseau14@gmail.com">pierregousseau14@gmail.com</a>> wrote:<br>
><br>
> pgousseau added a comment.<br>
><br>
> > > On Linux, if the timestamp of a header file, included in the pch, is modified, then including the pch without regenerating it causes a fatal error, which is reasonable.<br>
><br>
> ><br>
><br>
> > >  On Windows the check is ifdefed out, allowing the compilation to continue in a broken state.<br>
><br>
> ><br>
><br>
> > >  The root of the broken state is that, if timestamps dont match, the preprocessor will reparse a header without discarding the pch data.<br>
><br>
> ><br>
><br>
> > >  This leads to "#pragma once" header to be included twice.<br>
><br>
> ><br>
><br>
> > >  The reason behind the ifdefing of the check lacks documentation, and was done 6 years ago.<br>
><br>
> ><br>
><br>
><br>
><br>
><br>
> > It's documented in the comment you deleted:<br>
><br>
> ><br>
><br>
> >   // In our regression testing, the Windows file system seems to<br>
><br>
> >   // have inconsistent modification times that sometimes<br>
><br>
> >   // erroneously trigger this error-handling path.<br>
><br>
> ><br>
><br>
> ><br>
><br>
> > We should confirm whether this is in fact still the case. Maybe this is caused by building on a networked file system, where a locally-changed file might have a different mtime locally and remotely (the local mtime may be precise where the remote one has been rounded to a multiple of 2 seconds by an underlying FAT filesystem)? If it's something like that, we could perhaps work around this by rounding the mtime to a multiple of 2 seconds ourselves.<br>
><br>
><br>
> I am not sure how to reproduce this build scenario, would you be able to provide some more stepped details?<br>
> I have tried emitting and including a PCH on a networked FAT32 drive, but no false warnings observed so far.<br>
><br>
> Are you asking for the 2 seconds tolerance to be part of this patch?<br>
> Or, as it seems the main problem here is the lack of a reproducible, are you ok with the idea of committing this patch first, to see if the inconsistent time stamps is still an issue?</p>
<p dir="ltr">Yes, let's commit a patch to remove the #if first, and see if anything actually breaks (and if so, what). There's no need to add an option for this we have no uses for it.</p>
<p dir="ltr">> <a href="http://reviews.llvm.org/D20867">http://reviews.llvm.org/D20867</a><br>
><br>
><br>
></p>