diff options
author | Bob Moore <robert.moore@intel.com> | 2014-04-04 00:37:19 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-20 16:59:37 -0400 |
commit | 7ed823264845f7c2f14d3278405e593ddfdc50f6 (patch) | |
tree | b587bc9dc38c2d0b152eb585e5abd9158836959b /include/acpi | |
parent | 6085bb18afa431823a6287a0aa4d13641acb658d (diff) |
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 <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/platform/acgcc.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ | |||
64 | */ | 64 | */ |
65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
66 | 66 | ||
67 | /* | ||
68 | * Some versions of gcc implement strchr() with a buggy macro. So, | ||
69 | * undef it here. Prevents error messages of this form (usually from the | ||
70 | * file getopt.c): | ||
71 | * | ||
72 | * error: logical '&&' with non-zero constant will always evaluate as true | ||
73 | */ | ||
74 | #ifdef strchr | ||
75 | #undef strchr | ||
76 | #endif | ||
77 | |||
67 | #endif /* __ACGCC_H__ */ | 78 | #endif /* __ACGCC_H__ */ |