diff -ruN Singular-3-1-6/CMakeLists.txt Singular-3-1-6-patched/CMakeLists.txt
--- Singular-3-1-6/CMakeLists.txt	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/CMakeLists.txt	2021-05-01 20:00:40.000000000 -0500
@@ -120,12 +120,12 @@
 
   #set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
   set(CMAKE_C_FLAGS "-w -pipe ")
-  set(CMAKE_CXX_FLAGS "-w  -pipe ") #--no-rtti
+  set(CMAKE_CXX_FLAGS "-w  -pipe ") #-fno-rtti
   # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
   # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
   set(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer")
-  set(CMAKE_CXX_FLAGS_RELEASE "-O3 --no-rtti -fomit-frame-pointer")
+  set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-rtti -fomit-frame-pointer")
 
   #set(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG ")
   #set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG -DOM_NDEBUG")
diff -ruN Singular-3-1-6/IntegerProgramming/si_gmp.h Singular-3-1-6-patched/IntegerProgramming/si_gmp.h
--- Singular-3-1-6/IntegerProgramming/si_gmp.h	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/IntegerProgramming/si_gmp.h	2021-05-01 20:00:40.000000000 -0500
@@ -4,6 +4,7 @@
 #ifndef INCL_CF_GMP_H
 #define INCL_CF_GMP_H
 
+#include <stddef.h>
 #if defined(__cplusplus) && defined(__GNUC__)
 extern "C" {
 #undef __cplusplus
diff -ruN Singular-3-1-6/README Singular-3-1-6-patched/README
--- Singular-3-1-6/README	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/README	2021-05-01 20:00:40.000000000 -0500
@@ -113,17 +113,17 @@
 
      BEWARE: some of the option are for testing only,
      they will usually not work in general:
-     --with-Plural,--with-plural (you need a Singuilar version > 2.1.2 for this)
+     --with-Plural,--with-plural (you need a Singular version > 2.1.2 for this)
        (standard since  version 3-0-0)
      --with-sgroup (you need the sgroup programs for this)
      --with-smallgmp (not maintained), removed in 3-0-0
-     --with-namespaces (you need a Singuilar version > 2.1.x for this)
+     --with-namespaces (you need a Singular version > 2.1.x for this)
        (standard since  version 3-0-0)
      
 
   8. make install (resp. gmake install - the make program must be
-     GNU-Make) the make process will (hopefully) build:
-       1.   omalloc: the memry management routines (required)
+     GNU Make) the make process will (hopefully) build:
+       1.   omalloc: the memory management routines (required)
 
        2.   MP: Multi-Protocoll (optional)
 
@@ -172,7 +172,7 @@
        rebaseall
      before trying anything else
 
-   - MacOS X:
+   - Mac OS X:
      you need a file values.h where MP can find it (we copied one from
      Linux)
      ./configure -with-malloc=system
diff -ruN Singular-3-1-6/Singular/CMakeLists.txt Singular-3-1-6-patched/Singular/CMakeLists.txt
--- Singular-3-1-6/Singular/CMakeLists.txt	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/Singular/CMakeLists.txt	2021-05-01 20:00:40.000000000 -0500
@@ -158,7 +158,7 @@
 set_target_properties(sing-main PROPERTIES
   COMPILE_DEFINITIONS "${ADD_DEFS}${FLEXFLAGS}")
 set_target_properties(sing-main PROPERTIES
-  COMPILE_FLAGS "-fno-implicit-templates")
+  COMPILE_FLAGS "")
 
 #message(STATUS "=== '${CMAKE_CXX_FLAGS_DEBUG}'")
 #add_library(sing-main_g ${cxxsources})
diff -ruN Singular-3-1-6/Singular/Makefile.in Singular-3-1-6-patched/Singular/Makefile.in
--- Singular-3-1-6/Singular/Makefile.in	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/Singular/Makefile.in	2021-05-01 20:00:40.000000000 -0500
@@ -741,7 +741,7 @@
 
 CFLAGSG		= -g -Wall -Wno-unused ${PIPE}
 CXXFLAGSG	= -g -Wall -Wno-unused ${PIPE}
-CXXTEMPLFLAGSG	= -fno-implicit-templates
+CXXTEMPLFLAGSG	= 
 DEFSG		= -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILG)
 
 ##
@@ -820,7 +820,7 @@
 
 CFLAGSP		= -g -pg -O -Wall -Wno-unused ${PIPE}
 CXXFLAGSP	= -g -pg -O -Wall -Wno-unused ${PIPE}
-CXXTEMPLFLAGSP	= -fno-implicit-templates
+CXXTEMPLFLAGSP	= 
 DEFSP		= -D@SING_UNAME@ @DEFS@ -DDL_TAIL=$(DL_TAILP)
 
 ##
diff -ruN Singular-3-1-6/Singular/configure Singular-3-1-6-patched/Singular/configure
--- Singular-3-1-6/Singular/configure	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/Singular/configure	2021-05-01 20:00:40.000000000 -0500
@@ -4442,10 +4442,10 @@
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-  # check whether gcc accepts --no-rtti
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts --no-rtti" >&5
-$as_echo_n "checking whether gcc accepts --no-rtti... " >&6; }
-  CXXFLAGS="${CXXFLAGS} --no-rtti"
+  # check whether gcc accepts --fno-rtti
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts --fno-rtti" >&5
+$as_echo_n "checking whether gcc accepts --fno-rtti... " >&6; }
+  CXXFLAGS="${CXXFLAGS} --fno-rtti"
   if ${ac_cv_cxx_have_rtti+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -4475,14 +4475,14 @@
   if test "${ac_cv_cxx_have_rtti}" != yes; then
     CXXFLAGS="$temp_flags"
   else
-    CXXFLAGS="${temp_flags} --no-rtti"
+    CXXFLAGS="${temp_flags} --fno-rtti"
     temp_flags="${CXXFLAGS}"
   fi
 
-# check whether gcc accepts --no-exceptions
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts --no-exceptions" >&5
-$as_echo_n "checking whether gcc accepts --no-exceptions... " >&6; }
-  CXXFLAGS="${CXXFLAGS} --no-exceptions"
+# check whether gcc accepts -fno-exceptions
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc accepts -fno-exceptions" >&5
+$as_echo_n "checking whether gcc accepts -fno-exceptions... " >&6; }
+  CXXFLAGS="${CXXFLAGS} -fno-exceptions"
   if ${ac_cv_cxx_have_exceptions+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -4558,7 +4558,7 @@
   if test "${ac_cv_cxx_have_exceptions}" != yes; then
     CXXFLAGS="$temp_flags"
   else
-    CXXFLAGS="${temp_flags} --no-exceptions"
+    CXXFLAGS="${temp_flags} -fno-exceptions"
     temp_flags="${CXXFLAGS}"
   fi
 
@@ -4650,12 +4650,12 @@
   fi
   temp_flags="${CXXFLAGS}"
   if test "${ac_cv_cxx_have_rtti}" = yes; then
-    CXXFLAGS="${temp_flags} --no-rtti"
+    CXXFLAGS="${temp_flags} -fno-rtti"
   fi
   temp_flags="${CXXFLAGS}"
-  CXXTEMPLFLAGS="-fno-implicit-templates"
+  CXXTEMPLFLAGS=""
   if test "${ac_cv_cxx_have_exceptions}" = yes; then
-    CXXTEMPLFLAGS="${CXXTEMPLFLAGS} --no-exceptions"
+    CXXTEMPLFLAGS="${CXXTEMPLFLAGS} -fno-exceptions"
   fi
   if test "$ac_cv_is_aix" = yes; then
     CXXNOOPTFLAGS="-w"
diff -ruN Singular-3-1-6/Singular/libparse.cc Singular-3-1-6-patched/Singular/libparse.cc
--- Singular-3-1-6/Singular/libparse.cc	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/Singular/libparse.cc	2021-05-01 20:00:40.000000000 -0500
@@ -3504,14 +3504,14 @@
 }
 
 #ifdef STANDALONE_PARSER
-main( int argc, char *argv[] )
+int main( int argc, char *argv[] )
 {
   lib_style_types lib_style;
   main_init(argc, argv);
   if(yyin == NULL)
   {
     fprintf(stderr, "No library found to parse.\n");
-    exit(1);
+    return 1;
   }
   if (! (texinfo_out || category_out))
   {
@@ -3533,7 +3533,7 @@
   else if(pi!=NULL) printpi(pi);
   if (texinfo_out)
     printf("1;");
-  exit(0);
+  return 0;
 }
 
 #endif /* STANDALONE_PARSER */
diff -ruN Singular-3-1-6/Singular/libparse.l Singular-3-1-6-patched/Singular/libparse.l
--- Singular-3-1-6/Singular/libparse.l	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/Singular/libparse.l	2021-05-01 20:00:40.000000000 -0500
@@ -963,14 +963,14 @@
 }
 
 #ifdef STANDALONE_PARSER
-main( int argc, char *argv[] )
+int main( int argc, char *argv[] )
 {
   lib_style_types lib_style;
   main_init(argc, argv);
   if(yyin == NULL)
   {
     fprintf(stderr, "No library found to parse.\n");
-    exit(1);
+    return 1;
   }
   if (! (texinfo_out || category_out))
   {
@@ -992,7 +992,7 @@
   else if(pi!=NULL) printpi(pi);
   if (texinfo_out)
     printf("1;");
-  exit(0);
+  return 0;
 }
 
 #endif /* STANDALONE_PARSER */
diff -ruN Singular-3-1-6/dyn_modules/bigintm/SConstruct Singular-3-1-6-patched/dyn_modules/bigintm/SConstruct
--- Singular-3-1-6/dyn_modules/bigintm/SConstruct	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/dyn_modules/bigintm/SConstruct	2021-05-01 20:00:40.000000000 -0500
@@ -17,7 +17,7 @@
 
 #env.SharedObject(target = 'mod_main.o', source = 'mod_main.cc')
 
-CXXTEMPLFLAGS = "-fno-implicit-templates --no-exceptions"
+CXXTEMPLFLAGS = "-fno-exceptions"
 
 if env ['PLATFORM'] == "darwin":
     MACOSXMODULEFLAGS = '-twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup'
@@ -49,7 +49,7 @@
         SHLIBSUFFIX = ".so",
         CPPPATH = SING_INCLUDES,
         CPPDEFINES = ["NDEBUG", "OM_NDEBUG"],
-        CXXFLAGS = "-O3 -fomit-frame-pointer --no-rtti " + CXXTEMPLFLAGS,
+        CXXFLAGS = "-O3 -fomit-frame-pointer -fno-rtti " + CXXTEMPLFLAGS,
         CCFLAGS="-O3 -fomit-frame-pointer ",
         LDMODULEFLAGS = BUNDLETEMPFLAGS,
         LIBS=[])
diff -ruN Singular-3-1-6/dyn_modules/modgen/Makefile.in Singular-3-1-6-patched/dyn_modules/modgen/Makefile.in
--- Singular-3-1-6/dyn_modules/modgen/Makefile.in	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/dyn_modules/modgen/Makefile.in	2021-05-01 20:00:40.000000000 -0500
@@ -44,7 +44,7 @@
 ##
 ## compiler and linker options
 ##
-CFLAGS	+= --no-rtti --no-exceptions -O3 -w -fomit-frame-pointer -pipe -fno-implicit-templates \
+CFLAGS	+= -fno-rtti -fno-exceptions -O3 -w -fomit-frame-pointer -pipe \
 	-g -I${includedir} -I../include -I${topsrcdir}/.. -DNDEBUG -DMODULE_GENERATOR \
 	-D${SING_UNAME}
 LIBS	+= -L/usr/local/lib
diff -ruN Singular-3-1-6/dyn_modules/syzextra/SConstruct Singular-3-1-6-patched/dyn_modules/syzextra/SConstruct
--- Singular-3-1-6/dyn_modules/syzextra/SConstruct	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/dyn_modules/syzextra/SConstruct	2021-05-01 20:00:40.000000000 -0500
@@ -17,7 +17,7 @@
 
 #env.SharedObject(target = 'mod_main.o', source = 'mod_main.cc')
 
-CXXTEMPLFLAGS = "-fno-implicit-templates --no-exceptions"
+CXXTEMPLFLAGS = "-fno-exceptions"
 
 if env ['PLATFORM'] == "darwin":
     MACOSXMODULEFLAGS = '-twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup'
@@ -49,7 +49,7 @@
         SHLIBSUFFIX = ".so",
         CPPPATH = SING_INCLUDES,
         CPPDEFINES = ["NDEBUG", "OM_NDEBUG"],
-        CXXFLAGS = "-O3 -fomit-frame-pointer --no-rtti " + CXXTEMPLFLAGS,
+        CXXFLAGS = "-O3 -fomit-frame-pointer -fno-rtti " + CXXTEMPLFLAGS,
         CCFLAGS="-O3 -fomit-frame-pointer ",
         LDMODULEFLAGS = BUNDLETEMPFLAGS,
         LIBS=[])
diff -ruN Singular-3-1-6/factory/CMakeLists.txt Singular-3-1-6-patched/factory/CMakeLists.txt
--- Singular-3-1-6/factory/CMakeLists.txt	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/factory/CMakeLists.txt	2021-05-01 20:00:40.000000000 -0500
@@ -74,8 +74,8 @@
   if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
 
     #set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
-    set(CMAKE_CXX_FLAGS "-w --no-rtti -pipe ")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
+    set(CMAKE_CXX_FLAGS "-w -fno-rtti -pipe ")
+    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
     #add_definitions(-DNDEBUG -DOM_NDEBUG -Dx86_64_Linux -DHAVE_CONFIG_H)
 
     set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fomit-frame-pointer -DNDEBUG")
diff -ruN Singular-3-1-6/factory/GNUmakefile.in Singular-3-1-6-patched/factory/GNUmakefile.in
--- Singular-3-1-6/factory/GNUmakefile.in	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/factory/GNUmakefile.in	2021-05-01 20:00:40.000000000 -0500
@@ -99,11 +99,11 @@
 		$(DEFS) $(CPPFLAGS) $(CFLAGS) $(FLINT_CFLAGS)
 
 # flags to translate library c++ files
-LIBCXXFLAGS =	$(WARNFLAGS) -fno-implicit-templates \
+LIBCXXFLAGS =	$(WARNFLAGS) \
 		-I. -I.. -I$(srcdir) -I${prefix} -I$(includedir) \
 		$(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(FLINT_CFLAGS)
 
-LIBCGGFLAGS =	$(WARNFLAGS) -fno-implicit-templates \
+LIBCGGFLAGS =	$(WARNFLAGS) \
 		-I. -I.. -I$(srcdir) -I${prefix} -I$(includedir) \
 		$(DEFS) $(CPPFLAGS) $(FLINT_CFLAGS)
 
diff -ruN Singular-3-1-6/factory/examples/GNUmakefile Singular-3-1-6-patched/factory/examples/GNUmakefile
--- Singular-3-1-6/factory/examples/GNUmakefile	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/factory/examples/GNUmakefile	2021-05-01 20:00:40.000000000 -0500
@@ -46,7 +46,7 @@
 		$(DEFS) $(CPPFLAGS) $(CXXFLAGS)
 
 # flags to translate application
-APPLCXXFLAGS =	$(WARNFLAGS) -fno-implicit-templates \
+APPLCXXFLAGS =	$(WARNFLAGS) \
 		-I$(FACTORYPREFIX)/include \
 		$(DEFS) $(CPPFLAGS) $(CXXFLAGS)
 
diff -ruN Singular-3-1-6/kernel/ideals.h Singular-3-1-6-patched/kernel/ideals.h
--- Singular-3-1-6/kernel/ideals.h	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/kernel/ideals.h	2021-05-01 20:00:40.000000000 -0500
@@ -85,8 +85,8 @@
 #define idTest(A) idDBTest(A, PDEBUG, __FILE__,__LINE__)
 #define idPrint(id) idShow(id)
 #else
-#define idTest(A)  (TRUE)
-#define idPrint(A) ((void)0)
+#define idTest(A)  do {} while (0)
+#define idPrint(A) do {} while (0)
 #endif
 
 ideal id_Copy (ideal h1,const ring r);
diff -ruN Singular-3-1-6/kernel/kutil.cc Singular-3-1-6-patched/kernel/kutil.cc
--- Singular-3-1-6/kernel/kutil.cc	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/kernel/kutil.cc	2021-05-01 20:00:40.000000000 -0500
@@ -510,7 +510,7 @@
 static inline void enlargeL (LSet* L,int* length,const int incr)
 {
   assume((*L)!=NULL);
-  assume((length+incr)>0);
+  assume((length+incr)>(int*)0);
 
   *L = (LSet)omReallocSize((*L),(*length)*sizeof(LObject),
                                    ((*length)+incr)*sizeof(LObject));
@@ -6669,7 +6669,7 @@
 
 void kDebugPrint(kStrategy strat)
 {
-  extern long maxdegreeWecart(poly p,int *l, ring r = currRing); /*weight.h*/
+  extern long maxdegreeWecart(poly p,int *l, ring r); /*weight.h*/
   PrintS("red: ");
     if (strat->red==redFirst) PrintS("redFirst\n");
     else if (strat->red==redHoney) PrintS("redHoney\n");
diff -ruN Singular-3-1-6/kernel/si_gmp.h Singular-3-1-6-patched/kernel/si_gmp.h
--- Singular-3-1-6/kernel/si_gmp.h	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/kernel/si_gmp.h	2021-05-01 20:00:40.000000000 -0500
@@ -1,5 +1,6 @@
 #ifndef INCL_CF_GMP_H
 #define INCL_CF_GMP_H
+#include <stddef.h>
 #ifdef HAVE_FACTORY
 #  include <factory/cf_gmp.h>
 #else
diff -ruN Singular-3-1-6/libfac/CMakeLists.txt Singular-3-1-6-patched/libfac/CMakeLists.txt
--- Singular-3-1-6/libfac/CMakeLists.txt	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/libfac/CMakeLists.txt	2021-05-01 20:00:40.000000000 -0500
@@ -35,8 +35,8 @@
   if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
 
     #set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
-    set(CMAKE_CXX_FLAGS "-w --no-rtti -pipe ")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
+    set(CMAKE_CXX_FLAGS "-w -fno-rtti -pipe ")
+    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
     #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
     set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fomit-frame-pointer -DNDEBUG")
diff -ruN Singular-3-1-6/libfac/Makefile.dist Singular-3-1-6-patched/libfac/Makefile.dist
--- Singular-3-1-6/libfac/Makefile.dist	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/libfac/Makefile.dist	2021-05-01 20:00:40.000000000 -0500
@@ -20,7 +20,7 @@
 CHARDEFINES =
 DEFINES = $(FACDEFINES) $(CHARDEFINES)
 WARN = -Wall
-ALLFLAGS = -fno-implicit-templates 
+ALLFLAGS = 
 DEBFLAGS= -g $(DEFINES) $(ALLFLAGS)
 DEBFLAGSTMPL= -g $(DEFINES) 
 OPTFLAGS = -O3 $(DEFINES) $(ALLFLAGS) 
diff -ruN Singular-3-1-6/libfac/configure Singular-3-1-6-patched/libfac/configure
--- Singular-3-1-6/libfac/configure	2012-12-19 15:01:16.000000000 -0600
+++ Singular-3-1-6-patched/libfac/configure	2021-05-01 20:00:40.000000000 -0500
@@ -1024,7 +1024,7 @@
 
 
   fi
-  CXXTEMPLFLAGS="-fno-implicit-templates"
+  CXXTEMPLFLAGS=""
 
 
 else
