From bab0a0b577ba8cc28aa1e2b2e9ec65fb98edced1 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 27 Mar 2013 09:50:30 +0100 Subject: PDCurses: pdcscrn.c: Use `#ifdef` instead of `#if CONFIG_SPEAKER` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building libpayload with the PDCurses backend the following warning is shown. /src/coreboot/payloads/libpayload(master) $ make clean /src/coreboot/payloads/libpayload(master) $ make […] CC curses/pdcurses-backend/pdcscrn.libcurses.o curses/pdcurses-backend/pdcscrn.c: In function 'PDC_scr_open': curses/pdcurses-backend/pdcscrn.c:75:5: warning: "CONFIG_SPEAKER" is not defined [-Wundef] […] The GCC documentation states [1] In some contexts this shortcut is undesirable. The -Wundef option causes GCC to warn whenever it encounters an identifier which is not a macro in an ‘#if’. and therefore use `#ifdef` [2] to silence this warning. No functional change is done, as `CONFIG_SPEAKER` is assigned the value `Y` when defined. There was some discussion going on the list [3], but my points in there turned out to be incorrect. [1] http://gcc.gnu.org/onlinedocs/cpp/If.html [2] http://gcc.gnu.org/onlinedocs/cpp/Ifdef.html [3] http://www.coreboot.org/pipermail/coreboot/2013-March/075561.html Change-Id: I8e9c9b5d01985b21ad05018986d614cf9bf2b439 Signed-off-by: Paul Menzel Reviewed-on: http://review.coreboot.org/2934 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- payloads/libpayload/curses/pdcurses-backend/pdcscrn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c b/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c index d3f1849b89..e741b15d09 100644 --- a/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c +++ b/payloads/libpayload/curses/pdcurses-backend/pdcscrn.c @@ -72,7 +72,7 @@ int PDC_scr_open(int argc, char **argv) SP->lines = PDC_get_rows(); SP->cols = PDC_get_columns(); -#if CONFIG_SPEAKER +#ifdef CONFIG_SPEAKER SP->audible = TRUE; #endif -- cgit v1.2.3