File 0001-src-resolve-compiler-warnings-for-Wreturn-type.patch of Package singular

From 0e29c63bdc39264a23df345eaa3eb7a2c6951060 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Mon, 2 Jan 2012 13:12:19 +0100
Subject: [PATCH] src: resolve compiler warnings for -Wreturn-type

The compiler cannot always know that some places are not reached.

Minor.cc: In member function 'int MinorKey::getRelativeColumnIndex(int) const':
Minor.cc:284:1: warning: control reaches end of non-void function [-Wreturn-type]
Minor.cc: In member function 'int MinorKey::getRelativeRowIndex(int) const':
Minor.cc:253:1: warning: control reaches end of non-void function [-Wreturn-type]
Minor.cc: In member function 'int MinorKey::getAbsoluteColumnIndex(int) const':
Minor.cc:180:1: warning: control reaches end of non-void function [-Wreturn-type]
Minor.cc: In member function 'int MinorKey::getAbsoluteRowIndex(int) const':
Minor.cc:149:1: warning: control reaches end of non-void function [-Wreturn-type]
binomial.cc: In member function 'binomial& binomial::flip_variable(const short int&)':
binomial.cc:1850:1: warning: control reaches end of non-void function [-Wreturn-type]
minpoly.cc: In member function 'int NewVectorMatrix::findLargestNonpivot()':
minpoly.cc:387:1: warning: control reaches end of non-void function [-Wreturn-type]
minpoly.cc: In member function 'int NewVectorMatrix::findSmallestNonpivot()':
minpoly.cc:362:1: warning: control reaches end of non-void function [-Wreturn-type]
mod_main.cc: In function 'BOOLEAN {anonymous}::_p_Content(leftv, leftv)':
mod_main.cc:936:1: warning: control reaches end of non-void function [-Wreturn-type]
---
 IntegerProgramming/binomial.cc   |    2 +-
 Singular/Minor.cc                |    4 ++++
 Singular/minpoly.cc              |    2 ++
 dyn_modules/syzextra/mod_main.cc |    1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/IntegerProgramming/binomial.cc b/IntegerProgramming/binomial.cc
index 34a69be..c6a966f 100644
--- a/IntegerProgramming/binomial.cc
+++ b/IntegerProgramming/binomial.cc
@@ -1846,7 +1846,7 @@ binomial& binomial::flip_variable(const short& i)
   // Now flip the variable.
 
   exponent_vector[i]*=-1;
-
+  return *this;
 }
 
 ////////////////////////// output /////////////////////////////////////////
diff --git a/Singular/Minor.cc b/Singular/Minor.cc
index 147f257..35d6798 100644
--- a/Singular/Minor.cc
+++ b/Singular/Minor.cc
@@ -146,6 +146,7 @@ int MinorKey::getAbsoluteRowIndex(const int i) const
   }
   /* We should never reach this line of code. */
   assume(false);
+  return -1;
 }
 
 int MinorKey::getAbsoluteColumnIndex(const int i) const
@@ -177,6 +178,7 @@ int MinorKey::getAbsoluteColumnIndex(const int i) const
   }
   /* We should never reach this line of code. */
   assume(false);
+  return -1;
 }
 
 void MinorKey::getAbsoluteRowIndices(int* const target) const
@@ -250,6 +252,7 @@ int MinorKey::getRelativeRowIndex(const int i) const
   }
   /* We should never reach this line of code. */
   assume(false);
+  return -1;
 }
 
 int MinorKey::getRelativeColumnIndex(const int i) const
@@ -281,6 +284,7 @@ int MinorKey::getRelativeColumnIndex(const int i) const
   }
   /* We should never reach this line of code. */
   assume(false);
+  return -1;
 }
 
 unsigned int MinorKey::getRowKey(const int blockIndex) const
diff --git a/Singular/minpoly.cc b/Singular/minpoly.cc
index bcc1c46..1e8e2ab 100644
--- a/Singular/minpoly.cc
+++ b/Singular/minpoly.cc
@@ -6,6 +6,7 @@
 
 
 #include<cmath>
+#include <cstdlib>
 #include "config.h"
 #include<kernel/mod2.h>
 
@@ -384,6 +385,7 @@ int NewVectorMatrix::findLargestNonpivot ()
       return i;
     }
   }
+  abort();
 }
 
 
diff --git a/dyn_modules/syzextra/mod_main.cc b/dyn_modules/syzextra/mod_main.cc
index b4a94d5..ae1202d 100644
--- a/dyn_modules/syzextra/mod_main.cc
+++ b/dyn_modules/syzextra/mod_main.cc
@@ -933,6 +933,7 @@ static BOOLEAN _p_Content(leftv res, leftv h)
   pWrite(p); PrintLn();
   
   NoReturn(res);
+  return false;
 }
 
 END_NAMESPACE
-- 
1.7.10.4

openSUSE Build Service is sponsored by