[Mesa-dev] [PATCH 1/2] Update for fix or ignore the compile warning on android

jenny.q.cao jenny.q.cao at intel.com
Fri Apr 27 02:11:35 UTC 2018


force cast the I to GLint to avoid the compile warning when type is GLenum16, in
vendor/intel/external/mesa3d-intel/src/mesa/main/get.c:3005:19: warning: comparison of constant -32768 with
expression of type 'GLenum16' (aka 'unsigned short') is always false -Wtautologicalia-constant-out-of-range-compare,

ignore the compile warning vendor/intel/external/mesa3d-intel/src/intel/dev/gen_device_info.c:938:43: warning:
field 'base' with variable sized type 'struct drm_i915_query_topology_info' not at the end of a struct or class
is a GNU extension -Wgnu-variable-sized-type-not-at-end,

ignore the compile warning vendor/intel/external/mesa3d-intel/src/intel/compiler/spirv/spirv_to_nir.c  warning:
suggest braces around initialization of subobject -Wmissing-braces

Tests: compilation with warning clean
Signed-off-by: jenny.q.cao <jenny.q.cao at intel.com>
---
 src/compiler/Android.nir.mk | 3 +++
 src/intel/Android.dev.mk    | 3 +++
 src/mesa/main/get.c         | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/compiler/Android.nir.mk b/src/compiler/Android.nir.mk
index 75a247a245df..59da5dbdc1ca 100644
--- a/src/compiler/Android.nir.mk
+++ b/src/compiler/Android.nir.mk
@@ -41,6 +41,9 @@ LOCAL_C_INCLUDES := \
 	$(MESA_TOP)/src/gallium/include \
 	$(MESA_TOP)/src/gallium/auxiliary
 
+LOCAL_CFLAGS := \
+        -Wno-missing-braces
+
 LOCAL_STATIC_LIBRARIES := libmesa_compiler
 
 LOCAL_MODULE := libmesa_nir
diff --git a/src/intel/Android.dev.mk b/src/intel/Android.dev.mk
index cd2ed66a1768..3011ee232ed1 100644
--- a/src/intel/Android.dev.mk
+++ b/src/intel/Android.dev.mk
@@ -33,5 +33,8 @@ LOCAL_C_INCLUDES := $(MESA_TOP)/include/drm-uapi
 
 LOCAL_SRC_FILES := $(DEV_FILES)
 
+LOCAL_CFLAGS := \
+           -Wno-gnu-variable-sized-type-not-at-end
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 90ab7ca60f8b..5f9a60b0801c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -3002,7 +3002,7 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
       break;
 
    case TYPE_ENUM16:
-      params[0] = INT_TO_FIXED(((GLenum16 *) p)[0]);
+      params[0] = INT_TO_FIXED((GLint)(((GLenum16 *) p)[0]));
       break;
 
    case TYPE_INT_N:
-- 
1.9.1



More information about the mesa-dev mailing list