From 7a51384d24fe4da183fc15b2d17aa3c153b822e7 Mon Sep 17 00:00:00 2001 From: "Huang, Tao" Date: Sat, 21 Nov 2015 19:40:34 +0800 Subject: [PATCH] rk: add gcc-wrapper Change-Id: Ie5025f30a747cd40e26eeb6ec939de28af899645 Signed-off-by: Huang, Tao --- Makefile | 6 ++++++ scripts/gcc-wrapper.py | 19 +++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 3a0234f50f36..54698fb8396a 100644 --- a/Makefile +++ b/Makefile @@ -357,6 +357,12 @@ PERL = perl PYTHON = python CHECK = sparse +# Use the wrapper for the compiler. This wrapper scans for new +# warnings and causes the build to stop upon encountering them. +ifneq ($(wildcard $(srctree)/scripts/gcc-wrapper.py),) +CC = $(srctree)/scripts/gcc-wrapper.py $(CROSS_COMPILE)gcc +endif + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ -Wbitwise -Wno-return-void $(CF) CFLAGS_MODULE = diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py index 73ced6707c60..7a99344d6651 100755 --- a/scripts/gcc-wrapper.py +++ b/scripts/gcc-wrapper.py @@ -40,18 +40,13 @@ import subprocess # force LANG to be set to en_US.UTF-8 to get consistent warnings. allowed_warnings = set([ - "return_address.c:63", - "hid-appleir.c:347", - "hid-magicmouse.c:590", - "hid-ntrig.c:1026", - "core.c:1334", - "menu.c:129", - "bus.c:318", # FIXME - "atags_to_fdt.c:96", - "compat_binfmt_elf.c:58", - "psci.c:268", - "psci.c:273", - "sysctl_net_core.c:24", + "core.c:142", # drivers/regulator/core.c:142:6: warning: unused variable 'i' + "posix-cpu-timers.c:1268", # kernel/time/posix-cpu-timers.c:1268:13: warning: 'now' may be used uninitialized in this function + "af_unix.c:910", # net/unix/af_unix.c:910:20: warning: 'hash' may be used uninitialized in this function + "sunxi_sram.c:214", # drivers/soc/sunxi/sunxi_sram.c:214:24: warning: 'device' may be used uninitialized in this function + "ks8851.c:298", # drivers/net/ethernet/micrel/ks8851.c:298:2: warning: 'rxb[0]' may be used uninitialized in this function + "ks8851.c:421", # drivers/net/ethernet/micrel/ks8851.c:421:20: warning: 'rxb[0]' may be used uninitialized in this function + "rockchip_drm_vop.c:581", # drivers/gpu/drm/rockchip/rockchip_drm_vop.c:581:49: warning: 'vskiplines' may be used uninitialized in this function ]) # Capture the name of the object file, can find it. -- 2.34.1