From 569b721d5584ce874cb5f6b59d9f1d9b80530bd0 Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Sun, 6 Sep 2020 22:57:36 -0400 Subject: [PATCH] d/p/support_gcc10: Additionally avoid narrowing errors on e.g. i386. Tweak ncbifile.cpp to avoid narrowing errors on some platforms. --- debian/changelog | 4 +++- debian/patches/support_gcc10 | 42 ++++++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index b98d50eb..3c201483 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ ncbi-blast+ (2.10.0-2) UNRELEASED; urgency=medium * NOT RELEASED YET. + * debian/patches/support_gcc10: Additionally tweak ncbifile.cpp to avoid + narrowing errors on some platforms (i386, for one). - -- Aaron M. Ucko Sun, 06 Sep 2020 22:48:21 -0400 + -- Aaron M. Ucko Sun, 06 Sep 2020 22:57:35 -0400 ncbi-blast+ (2.10.0-1) unstable; urgency=medium diff --git a/debian/patches/support_gcc10 b/debian/patches/support_gcc10 index 5835200d..6f36dfa8 100644 --- a/debian/patches/support_gcc10 +++ b/debian/patches/support_gcc10 @@ -1,19 +1,26 @@ Author: Aaron M. Ucko -Date: Sun Apr 26 11:20:45 2020 -0400 +Date: Sun Sep 06 22:57:35 2020 -0400 Description: Support GCC 10+. Debian-Bug: 957581. -Formally recognize GCC 10 and up, even if (as in Debian) -dumpversion -reports only one or two components of the version number. Corresponds to +* build system: Formally recognize GCC 10 and up, even if (as in + Debian) -dumpversion reports only one or two components of the + version number. These patches correspond to merges of -https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88985 -https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88988 -https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88989 -https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=89711 + https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88985 + https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88988 + https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=88989 + https://www.ncbi.nlm.nih.gov/viewvc/v1?view=revision&revision=89711 -though the last of those doesn't apply cleanly without some -intervening changes for better Clang support. + though the last of those doesn't apply cleanly without some + intervening changes for better Clang support. +* ncbifile.cpp (s_GetFileSystemInfo): Formally cast st.f_type to avoid + narrowing errors for cases with the high bit set when that field is + a 32-bit signed integer (as on i386). + +Index: b/c++/src/build-system/config.h.in +=================================================================== --- a/c++/src/build-system/config.h.in +++ b/c++/src/build-system/config.h.in @@ -966,7 +966,7 @@ @@ -25,6 +32,8 @@ intervening changes for better Clang support. #undef NCBI_COMPILER_VERSION /* Compiler name */ +Index: b/c++/src/build-system/configure +=================================================================== --- a/c++/src/build-system/configure +++ b/c++/src/build-system/configure @@ -8233,9 +8233,10 @@ fi @@ -201,6 +210,8 @@ intervening changes for better Clang support. -*gcc|-il ) boost_comp_vers=`echo $compiler_version | cut -c1-2` ;; * ) boost_comp_vers='' ;; esac +Index: b/c++/src/build-system/configure.ac +=================================================================== --- a/c++/src/build-system/configure.ac +++ b/c++/src/build-system/configure.ac @@ -1257,9 +1257,10 @@ changequote(, )dnl @@ -386,3 +397,16 @@ intervening changes for better Clang support. -*gcc|-il ) boost_comp_vers=`echo $compiler_version | cut -c1-2` ;; * ) boost_comp_vers='' ;; esac +Index: b/c++/src/corelib/ncbifile.cpp +=================================================================== +--- a/c++/src/corelib/ncbifile.cpp ++++ b/c++/src/corelib/ncbifile.cpp +@@ -5129,7 +5129,7 @@ void s_GetFileSystemInfo(const string& + + GET_STATFS_INFO; + if (flags & (fFSI_Type | fFSI_DiskSpace)) { +- switch (st.f_type) { ++ switch (static_cast(st.f_type)) { + case 0xADF5: info->fs_type = CFileUtil::eADFS; break; + case 0xADFF: info->fs_type = CFileUtil::eAFFS; break; + case 0x5346414F: info->fs_type = CFileUtil::eAFS; break; -- 2.30.2