diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index d9553b9a7e1b8e3b46a4a8a1e31392cf62d0210c..af3689c6414e7b461e2c98209e63d68aec3105be 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -216,7 +216,7 @@ endif (DARWIN)
 
 
 if (LINUX OR DARWIN)
-  set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
+  set(GCC_WARNINGS "-Wall -Wno-unused-but-set-variable -Wno-sign-compare -Wno-trigraphs")
 
   if (NOT GCC_DISABLE_FATAL_WARNINGS)
     set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h
index 58cc2899afa84ecea89d9ee30861b0bf87431986..097a533b1a51c44d70846979755fb699cfa5b5d4 100644
--- a/indra/llcommon/llerrorlegacy.h
+++ b/indra/llcommon/llerrorlegacy.h
@@ -114,8 +114,10 @@ const int LL_ERR_PRICE_MISMATCH = -23018;
 
 #ifdef LL_WINDOWS
 #define llstatic_assert(func, msg) static_assert(func, msg)
+#define llstatic_assert_template(type, func, msg) static_assert(func, msg)
 #else
 #define llstatic_assert(func, msg) BOOST_STATIC_ASSERT(func)
+#define llstatic_assert_template(type, func, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && func);
 #endif
 
 // handy compile-time assert - enforce those template parameters! 
diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h
index 72a6020ff8e80918b7ec68f6f7606af2aa6309a4..c60088360752e6897d25711612a7975b2018993c 100644
--- a/indra/llcommon/llunit.h
+++ b/indra/llcommon/llunit.h
@@ -29,6 +29,7 @@
 
 #include "stdtypes.h"
 #include "llpreprocessor.h"
+#include "llerrorlegacy.h"
 
 namespace LLUnits
 {
@@ -53,7 +54,7 @@ struct ConversionFactor
 	static typename HighestPrecisionType<VALUE_TYPE>::type_t get()
 	{
 		// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
-		llstatic_assert(sizeof(DERIVED_UNITS_TAG) == 0, "Cannot convert between types.");
+		llstatic_assert_template(DERIVED_UNITS_TAG, false,  "Cannot convert between types.");
 	}
 };
 
@@ -141,7 +142,7 @@ struct LLUnit
 	void operator *= (LLUnit<OTHER_UNIT, OTHER_STORAGE> multiplicand)
 	{
 		// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
-		llstatic_assert(sizeof(OTHER_UNIT) == 0, "Multiplication of unit types not supported.");
+		llstatic_assert_template(OTHER_UNIT, 0, "Multiplication of unit types not supported.");
 	}
 
 	void operator /= (storage_t divisor)
@@ -153,7 +154,7 @@ struct LLUnit
 	void operator /= (LLUnit<OTHER_UNIT, OTHER_STORAGE> divisor)
 	{
 		// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
-		llstatic_assert(sizeof(OTHER_UNIT) == 0, "Illegal in-place division of unit types.");
+		llstatic_assert_template(OTHER_UNIT, 0, "Illegal in-place division of unit types.");
 	}
 
 	template<typename SOURCE_UNITS, typename SOURCE_STORAGE>
@@ -313,7 +314,7 @@ template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typen
 LLUnit<UNIT_TYPE1, STORAGE_TYPE1> operator * (LLUnit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnit<UNIT_TYPE2, STORAGE_TYPE2>)
 {
 	// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
-	llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported.");
+	llstatic_assert_template(STORAGE_TYPE1, 0, "Multiplication of unit types results in new unit type - not supported.");
 	return LLUnit<UNIT_TYPE1, STORAGE_TYPE1>();
 }
 
@@ -333,7 +334,7 @@ template<typename UNIT_TYPE1, typename STORAGE_TYPE1, typename UNIT_TYPE2, typen
 LLUnitImplicit<UNIT_TYPE1, STORAGE_TYPE1> operator * (LLUnitImplicit<UNIT_TYPE1, STORAGE_TYPE1>, LLUnitImplicit<UNIT_TYPE2, STORAGE_TYPE2>)
 {
 	// spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
-	llstatic_assert(sizeof(STORAGE_TYPE1) == 0, "Multiplication of unit types results in new unit type - not supported.");
+	llstatic_assert_template(STORAGE_TYPE1, 0, "Multiplication of unit types results in new unit type - not supported.");
 	return LLUnitImplicit<UNIT_TYPE1, STORAGE_TYPE1>();
 }
 
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 54b67832eaf099d4c0c9ff818636cbb1238f161b..47ba0c4fc40c18fa46dce87fe74d0cc06573e984 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -6066,12 +6066,13 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
 	S32 max_t = volume->getPath().mPath.size();
 
 	// S32 i;
-	S32 num_vertices = 0, num_indices = 0;
+	//S32 num_vertices = 0;
+	//S32 num_indices = 0;
 	S32	grid_size = (profile.size()-1)/4;
-	S32	quad_count = (grid_size * grid_size);
+	//S32	quad_count = (grid_size * grid_size);
 
-	num_vertices = (grid_size+1)*(grid_size+1);
-	num_indices = quad_count * 4;
+	//num_vertices = (grid_size+1)*(grid_size+1);
+	//num_indices = quad_count * 4;
 
 	LLVector4a& min = mExtents[0];
 	LLVector4a& max = mExtents[1];
@@ -6667,10 +6668,6 @@ void LLVolumeFace::resizeVertices(S32 num_verts)
 		mPositions = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
 		ll_assert_aligned(mPositions, 16);
 		mNormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
-		if ( ((int)mNormals & 0xF) != 0 )
-		{
-			__debugbreak();
-		}
 		ll_assert_aligned(mNormals, 16);
 
 		//pad texture coordinate block end to allow for QWORD reads
diff --git a/indra/newview/llworldmapmessage.h b/indra/newview/llworldmapmessage.h
index 12b6ef47920d57748f98d72aaa09a0418983dc4c..ac1ea1607c793d6370d3f3e95cd4f414c9889a26 100644
--- a/indra/newview/llworldmapmessage.h
+++ b/indra/newview/llworldmapmessage.h
@@ -27,6 +27,8 @@
 #ifndef LL_LLWORLDMAPMESSAGE_H
 #define LL_LLWORLDMAPMESSAGE_H
 
+#include "boost/function.hpp"
+
 // Handling of messages (send and process) as well as SLURL callback if necessary
 class LLMessageSystem;