Index: SConstruct
--- SConstruct.orig
+++ SConstruct
@@ -2179,7 +2179,7 @@ help:assume compiler supports __attribute__((unused))
 		self._check_macro(context,macro_name=macro_name,macro_value=macro_value,test="""
 dxx_compiler_attribute_unused
 static void a(){}
-""", msg='for function __attribute__((unused))', successflags={'CXXFLAGS' : get_Werror_sequence(context.env['CXXFLAGS'], ('-Wunused',))})
+""", msg='for function __attribute__((unused))', successflags={'CXXFLAGS' : ''})
 
 	@_custom_test
 	def check_cxx11_static_assert(self,context,_f='''
@@ -2495,7 +2495,7 @@ $ x86_64-pc-linux-gnu-g++-5.4.0 -x c++ -S -Wformat -o 
 	@_custom_test
 	def check_compiler_useless_cast(self,context):
 		Compile = self.Compile
-		flags = {'CXXFLAGS' : get_Werror_sequence(context.env['CXXFLAGS'], ('-Wuseless-cast',))}
+		flags = {'CXXFLAGS' : ''}
 		if Compile(context, text='''
 /*
  * SDL on Raspbian provokes a warning from -Wuseless-cast
@@ -4723,11 +4723,6 @@ class DXXCommon(LazyObjectConstructor):
 		env = self.env
 		user_settings = self.user_settings
 
-		# Insert default CXXFLAGS.  User-specified CXXFLAGS, if any, are
-		# appended to this list and will override these defaults.  The
-		# defaults are present to ensure that a user who does not set
-		# any options gets a good default experience.
-		env.Prepend(CXXFLAGS = ['-g', '-O2'])
 		# Raspberry Pi?
 		if user_settings.raspberrypi == 'yes':
 			rpi_vc_path = user_settings.rpi_vc_path
