d/p/support_gcc10: Additionally avoid narrowing errors on e.g. i386.
authorAaron M. Ucko <ucko@debian.org>
Mon, 7 Sep 2020 02:57:36 +0000 (22:57 -0400)
committerAaron M. Ucko <ucko@debian.org>
Mon, 7 Sep 2020 02:57:36 +0000 (22:57 -0400)
Tweak ncbifile.cpp to avoid narrowing errors on some platforms.

debian/changelog
debian/patches/support_gcc10

index b98d50ebb13c02e8a9ca3385e0ea21979f9f0f6e..3c2014839eb3f7477c70fdbcc5366ff8ace3fa2a 100644 (file)
@@ -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 <ucko@debian.org>  Sun, 06 Sep 2020 22:48:21 -0400
+ -- Aaron M. Ucko <ucko@debian.org>  Sun, 06 Sep 2020 22:57:35 -0400
 
 ncbi-blast+ (2.10.0-1) unstable; urgency=medium
 
index 5835200d46d105963f399f577615113a1f0acf99..6f36dfa802b609883ca5ea37eb4f1034e29128b2 100644 (file)
@@ -1,19 +1,26 @@
 Author: Aaron M. Ucko <ucko@debian.org>
-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<Uint4>(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;