Fix braces warning treated as error.

On some platforms, nested braces are required for nested initializers,
or a warning will be produced which is treated as an error.

Change-Id: I4806ee13869bfe5c5c41505552cd03ff6bdde85e
Reviewed-on: https://swiftshader-review.googlesource.com/20248
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a37ce2..17b488d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -165,6 +165,7 @@
     set_cpp_flag("-Wall")
     set_cpp_flag("-Werror=reorder")
     set_cpp_flag("-Werror=sign-compare")
+    set_cpp_flag("-Werror=missing-braces")
     set_cpp_flag("-fno-exceptions")
 
     # Remove xor, and, or and friends from the list of keywords, they are used
diff --git a/tests/unittests/unittests.cpp b/tests/unittests/unittests.cpp
index 91b34cd..41d4fb9 100644
--- a/tests/unittests/unittests.cpp
+++ b/tests/unittests/unittests.cpp
@@ -612,18 +612,18 @@
 	EXPECT_NE(linkStatus, 0);
 	EXPECT_GLENUM_EQ(GL_NONE, glGetError());
 
-	float vertices[18] = { -1.0f,  1.0f, 0.5f,
-	                       -1.0f, -1.0f, 0.5f,
-	                        1.0f, -1.0f, 0.5f,
-	                       -1.0f,  1.0f, 0.5f,
-	                        1.0f, -1.0f, 0.5f,
-	                        1.0f,  1.0f, 0.5f };
+	float vertices[6][3] = { { -1.0f,  1.0f, 0.5f },
+	                         { -1.0f, -1.0f, 0.5f },
+	                         {  1.0f, -1.0f, 0.5f },
+	                         { -1.0f,  1.0f, 0.5f },
+	                         {  1.0f, -1.0f, 0.5f },
+	                         {  1.0f,  1.0f, 0.5f } };
 
-	float attributes[5][4] = { 1.0f, 2.0f, 3.0f, 4.0f,
-	                           5.0f, 6.0f, 7.0f, 8.0f,
-	                           9.0f, 10.0f, 11.0f, 12.0f,
-	                           13.0f, 14.0f, 15.0f, 16.0f,
-	                           17.0f, 18.0f, 19.0f, 20.0f };
+	float attributes[5][4] = { { 1.0f, 2.0f, 3.0f, 4.0f },
+	                           { 5.0f, 6.0f, 7.0f, 8.0f },
+	                           { 9.0f, 10.0f, 11.0f, 12.0f },
+	                           { 13.0f, 14.0f, 15.0f, 16.0f },
+	                           { 17.0f, 18.0f, 19.0f, 20.0f } };
 
 	GLint a0 = glGetAttribLocation(ph.program, "a0");
 	EXPECT_EQ(a0, 0);