tags 835746 +patch
thanks.

The debian odin package contains two gcc-6 related patches.

gcc-6-fix.patch and gcc-fix2.patch

Poking arround upstream svn I also found two gcc-6 fix commits.

r8691 and r8691

gcc-6-fix.patch seemed to be the same as upstream commit r8691
gcc-6-fix2.patch seemed to contain a subset of the fixes in upstream commit r8691

I replaced gcc-fix2.patch with a patch generated from upstream commit r8691 and the package built successfully in raspbian stretch.

I have uploaded the fix to raspbian. Debdiff attatched, no intent to NMU in Debian.
diff -Nru odin-2.0.2/debian/changelog odin-2.0.2/debian/changelog
--- odin-2.0.2/debian/changelog 2016-07-22 11:58:53.000000000 +0000
+++ odin-2.0.2/debian/changelog 2016-12-11 00:28:16.000000000 +0000
@@ -1,3 +1,10 @@
+odin (2.0.2-0.3+rpi1) stretch-staging; urgency=medium
+
+  * Replace gcc-6-fix2 with upstream commit r8691 which contains
+    the fix previously in that patch plus some further fixes.
+
+ -- Peter Michael Green <plugw...@raspbian.org>  Sun, 11 Dec 2016 00:28:16 
+0000
+
 odin (2.0.2-0.3) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru odin-2.0.2/debian/patches/gcc-6-fix2.patch 
odin-2.0.2/debian/patches/gcc-6-fix2.patch
--- odin-2.0.2/debian/patches/gcc-6-fix2.patch  2016-07-22 11:58:22.000000000 
+0000
+++ odin-2.0.2/debian/patches/gcc-6-fix2.patch  2016-12-11 00:15:26.000000000 
+0000
@@ -1,24 +1,69 @@
-Description: Fix some std::max(double,float) call mismatch and some "ifstream 
not comparable with NULL"
-
-Author: Gianfranco Costamagna <locutusofb...@debian.org>
-
---- odin-2.0.2.orig/cmdline-utils/swab.cpp
-+++ odin-2.0.2/cmdline-utils/swab.cpp
-@@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
+--- odin/odinseq/seqplot.h     (revision 8690)
++++ odin/odinseq/seqplot.h     (revision 8691)
+@@ -33,10 +33,10 @@
+ static const char* markLabel[]={"none",     "exttrigger",       
"halttrigger",     "snapshot",      "reset",      "acquisition",      "endacq", 
     "excitation",      "refocusing",      "storeMagn",      "recallMagn",      
"inversion",      "saturation" };
+ AVOID_CC_WARNING(markLabel)
+ 
+-enum timecourseMode                   {tcmode_curves=0, tcmode_plain,   
tcmode_slew_rate,                tcmode_kspace,         tcmode_M1,              
                  tcmode_M2,                                  tcmode_b_trace,   
                      tcmode_backgr_kspace,  tcmode_backgr_crossterm,           
     tcmode_eddy_currents, numof_tcmodes};
+-static const char* timecourseLabel[]= {"Curves",        "Plain",        "Slew 
Rate",                     "k-Space",             "1st Grad. Moment",           
            "2nd Grad. Moment",                         "b-Value Trace",        
                "Backgr. k-Space",     "Backgr. Crossterm",                    
"Eddy Currents"};
+-static const char* timecoursePrefix[]={"G",              "G",           "dG", 
                           "k",                   "M1",                         
            "M2",                                       "b",                    
                "k",                   "c",                                    
"G"};
+-static const char* timecourseUnit[]=  {ODIN_GRAD_UNIT,  ODIN_GRAD_UNIT, 
ODIN_GRAD_UNIT"/"ODIN_TIME_UNIT, "rad/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT 
"/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT "^2/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT 
"/" ODIN_SPAT_UNIT "^2", "rad/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT "/" 
ODIN_SPAT_UNIT "^2", ODIN_GRAD_UNIT};
++enum timecourseMode                   {tcmode_curves=0, tcmode_plain,   
tcmode_slew_rate,                  tcmode_kspace,         tcmode_M1,            
                    tcmode_M2,                                  tcmode_b_trace, 
                        tcmode_backgr_kspace,  tcmode_backgr_crossterm,         
       tcmode_eddy_currents, numof_tcmodes};
++static const char* timecourseLabel[]= {"Curves",        "Plain",        "Slew 
Rate",                       "k-Space",             "1st Grad. Moment",         
              "2nd Grad. Moment",                         "b-Value Trace",      
                  "Backgr. k-Space",     "Backgr. Crossterm",                   
 "Eddy Currents"};
++static const char* timecoursePrefix[]={"G",              "G",           "dG", 
                             "k",                   "M1",                       
              "M2",                                       "b",                  
                  "k",                   "c",                                   
 "G"};
++static const char* timecourseUnit[]=  {ODIN_GRAD_UNIT,  ODIN_GRAD_UNIT, 
ODIN_GRAD_UNIT "/" ODIN_TIME_UNIT, "rad/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT 
"/" ODIN_SPAT_UNIT, "rad*" ODIN_TIME_UNIT "^2/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT 
"/" ODIN_SPAT_UNIT "^2", "rad/" ODIN_SPAT_UNIT, ODIN_TIME_UNIT "/" 
ODIN_SPAT_UNIT "^2", ODIN_GRAD_UNIT};
+ AVOID_CC_WARNING(timecourseLabel)
+ AVOID_CC_WARNING(timecoursePrefix)
+ AVOID_CC_WARNING(timecourseUnit)
+--- odin/odinseq/seqgradspiral.cpp     (revision 8690)
++++ odin/odinseq/seqgradspiral.cpp     (revision 8691)
+@@ -26,13 +26,13 @@
+     float s=1.0-float(i)/float(TEST_NPTS-1);
+     const kspace_coord& tds=traj_cache->calculate(s);
+     if(i) {
+-      
deltaKtangential=STD_max(double(deltaKtangential),norm(tds.kx-last_kx,tds.ky-last_ky));
+-      max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gx-last_Gx));
+-      max_grad_diff=STD_max(double(max_grad_diff),fabs(tds.Gy-last_Gy));
++      
deltaKtangential=STD_max(deltaKtangential,float(norm(tds.kx-last_kx,tds.ky-last_ky)));
 // casts
++      max_grad_diff=STD_max(max_grad_diff,float(fabs(tds.Gx-last_Gx)));       
               // required
++      max_grad_diff=STD_max(max_grad_diff,float(fabs(tds.Gy-last_Gy)));       
               // for GCC6/C++11
+     }
+ 
+-    max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gx));
+-    max_grad_magn=STD_max(double(max_grad_magn),fabs(tds.Gy));
++    max_grad_magn=STD_max(max_grad_magn,float(fabs(tds.Gx))); // casts 
required
++    max_grad_magn=STD_max(max_grad_magn,float(fabs(tds.Gy))); // for 
GCC6/C++11
+ 
+     last_kx=tds.kx;
+     last_ky=tds.ky;
+--- odin/odinseq/odinpulse_trajectories.cpp    (revision 8690)
++++ odin/odinseq/odinpulse_trajectories.cpp    (revision 8691)
+@@ -180,7 +180,7 @@
+        "In the inner part of k-space the radius increases linerly with 
time,\n"
+        "while in the outer part the distance between adjacent sampling points 
along the\n"
+        "trajectory in k-space is kept constant.\n"
+-       "The "_TRAJ_OPTIMIZE_PARLABEL_" parameter determines the relative 
point in time (between\n"
++       "The " _TRAJ_OPTIMIZE_PARLABEL_ " parameter determines the relative 
point in time (between\n"
+        "0.0 and 1.0) where the switching between these two modes occurs.");
+   }
+ 
+--- odin/cmdline-utils/swab.cpp        (revision 8690)
++++ odin/cmdline-utils/swab.cpp        (revision 8691)
+@@ -28,7 +28,7 @@
    }
  
    std::ifstream in_data(argv[2],std::ios::in|std::ios::binary);
 -  if(in_data == NULL) {
-+  if(in_data.fail()) {
++  if(in_data.bad()) {
      std::cerr << "swab: ERROR: can't open file " << argv[2] << std::endl;
      return -1;
    }
-@@ -56,14 +56,14 @@ int main(int argc, char* argv[]) {
+@@ -56,14 +56,14 @@
    for(k=0;k<n_data/block_size;k++) {
      if(k == 0) {
        out_data.open(argv[3],std::ios::out|std::ios::binary);
 -      if(out_data == NULL) {
-+      if(out_data.fail()) {
++      if(out_data.bad()) {
          std::cerr << "swab: ERROR: can't open file " << argv[3] << std::endl;
          return -1;
        }
@@ -26,7 +71,7 @@
      else {
        out_data.open(argv[3],std::ios::out|std::ios::binary|std::ios::app);
 -      if(out_data == NULL) {
-+      if(out_data.fail()) {
++      if(out_data.bad()) {
          std::cerr << "swab: ERROR: can't open file " << argv[3] << std::endl;
          return -1;
        }

Reply via email to