瀏覽代碼

build: make passing an incorrect pointer type a hard error

More or less any of this issue pointed out by the compiler is
a coding error. Make sure we flag it and bail loudly.

v2: - apply the change to autotools and scons as well (Emil)
    - C++ doesn't need this, it's already an error and the flag
      doesn't exist (Gert)
v3: - drop scons, flags are not checked so until someone adds that
      functionality we can't have this.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> # v1
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> # v1
[Emil: apply the same change to autotools and scons]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
tags/19.1-branchpoint
Eric Engestrom 6 年之前
父節點
當前提交
e1d81decf7
共有 3 個檔案被更改,包括 3 行新增0 行删除
  1. 1
    0
      Android.common.mk
  2. 1
    0
      configure.ac
  3. 1
    0
      meson.build

+ 1
- 0
Android.common.mk 查看文件

@@ -32,6 +32,7 @@ LOCAL_C_INCLUDES += \
MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
LOCAL_CFLAGS += \
-Wno-error \
-Werror=incompatible-pointer-types
-Wno-unused-parameter \
-Wno-pointer-arith \
-Wno-missing-field-initializers \

+ 1
- 0
configure.ac 查看文件

@@ -320,6 +320,7 @@ dnl
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration], [CFLAGS="$CFLAGS -Werror=implicit-function-declaration"])
AX_CHECK_COMPILE_FLAG([-Werror=missing-prototypes], [CFLAGS="$CFLAGS -Werror=missing-prototypes"])
AX_CHECK_COMPILE_FLAG([-Werror=incompatible-pointer-types], [CFLAGS="$CFLAGS -Werror=incompatible-pointer-types"])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
dnl Dylan Baker: gcc and clang always accepr -Wno-*, hence check for the original warning, then set the no-* flag
AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wno-missing-field-initializers"])

+ 1
- 0
meson.build 查看文件

@@ -804,6 +804,7 @@ endif
c_args = []
foreach a : ['-Werror=implicit-function-declaration',
'-Werror=missing-prototypes', '-Werror=return-type',
'-Werror=incompatible-pointer-types',
'-fno-math-errno',
'-fno-trapping-math', '-Qunused-arguments']
if cc.has_argument(a)

Loading…
取消
儲存