From: Bob Moore Date: Fri, 4 Apr 2014 04:37:19 +0000 (+0800) Subject: ACPICA: gcc-specific: Fix possible issue with the strchr function. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7ed823264845f7c2f14d3278405e593ddfdc50f6;p=linux-beck.git ACPICA: gcc-specific: Fix possible issue with the strchr function. Some versions of gcc implement strchr via a macro, which either contains bugs or can provoke a bug in the compiler. This change fixes a possible compile-time error when using this function. The problem is usually seen when compiling the getopt.c module. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index a476b9118b49..384875da3713 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -64,4 +64,15 @@ */ #define ACPI_UNUSED_VAR __attribute__ ((unused)) +/* + * Some versions of gcc implement strchr() with a buggy macro. So, + * undef it here. Prevents error messages of this form (usually from the + * file getopt.c): + * + * error: logical '&&' with non-zero constant will always evaluate as true + */ +#ifdef strchr +#undef strchr +#endif + #endif /* __ACGCC_H__ */