From: Paul Eggert Date: Fri, 7 Oct 2005 18:53:20 +0000 (+0000) Subject: (AC_HEADER_STDBOOL): Add an "#ifdef __xlc__" test, X-Git-Tag: v5.91~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25041cf0f9d055198d4744ee0fa4602bc9ce9198;p=thirdparty%2Fcoreutils.git (AC_HEADER_STDBOOL): Add an "#ifdef __xlc__" test, since yesterday's attempt didn't work. --- diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index 945a036531..8893d0b1ea 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -71,6 +71,22 @@ AC_DEFUN([AC_HEADER_STDBOOL], _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + #if defined __xlc__ || __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + . + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a run-time + test, and that would make crosss-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); + #endif ], [ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l