[med-svn] [Git][med-team/mapsembler2][master] 3 commits: add gcc11.patch

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Mon Jul 12 22:05:53 BST 2021



Étienne Mollier pushed to branch master at Debian Med / mapsembler2


Commits:
ad3aaa28 by Étienne Mollier at 2021-07-12T22:19:37+02:00
add gcc11.patch

This patch addresses a couple of issues flagged by the newer versions
of the compiler: Gcc 11.  At a couple of occurrence, a pointer is used
as an iterator of hashes, but the pointer arithmetics is done directly
on pointer types, disregarding their signedness.  Casting to ssize_t
is done where the lack of casting provokes build failures, and also
where casting is already done using other types which might mismatch
the architecture size (typically, long ints are in use there.)

Closes: #984226

- - - - -
7d854e08 by Étienne Mollier at 2021-07-12T23:03:19+02:00
gcc11.patch: dep3 header

- - - - -
ebc4eeeb by Étienne Mollier at 2021-07-12T23:03:58+02:00
update changelog

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/gcc11.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -5,8 +5,10 @@ mapsembler2 (2.2.4+dfsg1-4) UNRELEASED; urgency=medium
   * d/control: standard version 4.5.1
   * d/mans/mapsembler2_kissreads.1: fix typo-in-manual-page
   * spelling.patch: fix spelling-error-in-binary
+  * add gcc11.patch (Closes: #984226)
+  * gcc11.patch: dep3 header
 
- -- Étienne Mollier <emollier at debian.org>  Sat, 03 Jul 2021 00:10:43 +0200
+ -- Étienne Mollier <emollier at debian.org>  Mon, 12 Jul 2021 23:03:30 +0200
 
 mapsembler2 (2.2.4+dfsg1-3) unstable; urgency=medium
 


=====================================
debian/patches/gcc11.patch
=====================================
@@ -0,0 +1,70 @@
+Description: fix ftbfs with gcc 11
+ Starting with Gcc 11, ordering relations against pointers are now flagged.
+ This is especially useful to spot iterators with types mismatches compared
+ to the CPU architecture they run on.  In this particular case, an iterator
+ is used on a couple of occasions, and tested against with "less than 0"
+ comparisons.  In a few situations the absence of typing might have caused
+ issues already, because some occurrences are cast to "long int".  In order
+ to match the CPU architecture size, and avoid architecture specific bugs,
+ the proper type would more probably be ssize_t.  This type is cast where
+ needed.
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984226
+Forwarded: no
+Last-Update: 2021-07-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- mapsembler2.orig/kissreads_graph/read_coherence_mapsembler/interface_libchash.cpp
++++ mapsembler2/kissreads_graph/read_coherence_mapsembler/interface_libchash.cpp
+@@ -131,7 +131,7 @@
+ 	 hash_iter iterator=hash_iterator_init(map);
+ 
+ 	 /*	 is the hash table empty?  */
+-	 if (iterator < 0)
++	 if ((ssize_t)iterator < 0)
+ 		 return;
+ 
+ 	char *key;
+@@ -166,7 +166,7 @@
+ 	 hash_iter iterator=hash_iterator_init(map);
+ 
+ 	 /*	 is the hash table empty?  */
+-	 if (iterator < 0)
++	 if ((ssize_t)iterator < 0)
+ 		 return 0;
+ 
+ 	char *key;
+@@ -194,7 +194,7 @@
+ 
+     /*	 is the hash table empty?  */
+     //    printf("freeing from iterator %llx\n", iterator);
+-    if ((long int)iterator < 0)
++    if ((ssize_t)iterator < 0)
+       return;
+ 
+     char *key;
+@@ -263,13 +263,13 @@
+ 
+  hash_iter hash_iterator_is_end(hash_t map, hash_iter iter){
+    // 	 return (hash_iter)(iter==NULL || (int)iter == -1);
+-   return (hash_iter)(iter==NULL || (long int)iter ==-1);
++   return (hash_iter)(iter==NULL || (ssize_t)iter ==-1);
+   }
+ 
+   ssize_t hash_iterator_return_entry(hash_t map, hash_iter iter,
+  		char **key, void **data){
+  	assert(map != NULL);
+- 	assert(iter >= 0);
++ 	assert((ssize_t)iter > 0);
+  	assert(key != NULL);
+  	assert(data != NULL);
+  	if (!hash_iterator_is_end(map, iter))
+@@ -520,7 +520,7 @@
+ 
+         // Go through the hashmap Mapped and for each fragment
+         // get the reads that have seeds that match somewhere on this fragment
+-        if((long int)iterator!=-1){
++        if((ssize_t)iterator!=-1){
+                 while(!hash_iterator_is_end(map, iterator)){     // go through all the mapped reads
+                         hash_iterator_return_entry(map, iterator, &key, (void**)&mapping_positions); // get key(read) and corresponding mapping positions (pwi)
+                         if(mapping_positions){


=====================================
debian/patches/series
=====================================
@@ -9,3 +9,4 @@ no_std_hash_redefinition.patch
 gcc10.patch
 check_memory.patch
 cross.patch
+gcc11.patch



View it on GitLab: https://salsa.debian.org/med-team/mapsembler2/-/compare/df74cc12f18b06e63bc2832ba3a0fee34d71afa8...ebc4eeebeb97d7b40b60d8ffb0d568c847ffb786

-- 
View it on GitLab: https://salsa.debian.org/med-team/mapsembler2/-/compare/df74cc12f18b06e63bc2832ba3a0fee34d71afa8...ebc4eeebeb97d7b40b60d8ffb0d568c847ffb786
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210712/86b802bc/attachment-0001.htm>


More information about the debian-med-commit mailing list