summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-24 15:51:59 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-24 15:55:29 (GMT)
commitf699323ade84bb672ed0998de73c6f0333981bc1 (patch)
treeb0fc9577aafd3ce2ba9fcaa7412f7a6720da75a4 /Source/cmDependsFortran.cxx
parentf59513140bf086eda2029c5b4e950fc58216c06e (diff)
downloadCMake-f699323ade84bb672ed0998de73c6f0333981bc1.zip
CMake-f699323ade84bb672ed0998de73c6f0333981bc1.tar.gz
CMake-f699323ade84bb672ed0998de73c6f0333981bc1.tar.bz2
Fortran: Fix .mod file comparison for Intel 16 format
The Intel 16 format starts with the 0x0A 0x00 sequence that we use to skip past the timestamp. This occurrence appears to be a version number. Skip the first byte to avoid matching the sequence early. Ideally we should gain a better understanding of the format and avoid depending on short sequences that are likely to appear early by coincidence, but this approach will suffice for now. Closes: #16263
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r--Source/cmDependsFortran.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 38e319d..4608b5a 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -677,6 +677,12 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
const char seq[2] = { '\n', '\0' };
const int seqlen = 2;
+ // Skip the leading byte which appears to be a version number.
+ // We do not need to check for an error because the sequence search
+ // below will fail in that case.
+ finModFile.get();
+ finStampFile.get();
+
if (!cmFortranStreamContainsSequence(finModFile, seq, seqlen)) {
// The module is of unexpected format. Assume it is different.
std::cerr << compilerId << " fortran module " << modFile