]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE builds
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 24 Mar 2016 06:28:20 +0000 (07:28 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 25 Mar 2016 09:53:02 +0000 (10:53 +0100)
commit20d00edf21d2f2144921622891d8b59a1553cd83
treebf8aa755a540ec725aebf630be4397518e110002
parent6c7f3f1d5921d0cd27f975af8cb723732b3ab158
BaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE builds

This aligns the GCC definitions for 4.6 and up to align with the ARM and
AARCH64 definitions, which is to ignore unused but set variables only on
RELEASE builds. This allows us to find instances of unused variables that
are left behind after refactoring. It also allows us to find bad new code,
which, due to the EDK2 coding style which disallows initialized automatic
variables, may contain such variables without having been noticed by other
toolchains.

(Slightly edited) observation from Jordan Justen
<jordan.l.justen@intel.com>: RELEASE builds must keep the flag because
debug code (such as assertions) may collapse to nothing -- e.g. if a
platform defines MDEPKG_NDEBUG for RELEASE -- and therefore trigger the
warning.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
[lersek@redhat.com: incorporate commit message update from Jordan]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
BaseTools/Conf/tools_def.template