From eaebfec990d331f44b527fda650dcf68197a5043 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 13 Dec 2005 19:41:57 +0000 Subject: [PATCH] (AC_HEADER_STDBOOL): Check for buggy compiler that has _Bool but mishandles _Bool |= _Bool. --- m4/ChangeLog | 5 +++++ m4/stdbool.m4 | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/m4/ChangeLog b/m4/ChangeLog index 25dad52d11..206ae17789 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2005-12-13 Paul Eggert + + * stdbool.m4 (AC_HEADER_STDBOOL): Check for buggy compiler that + has _Bool but mishandles _Bool |= _Bool. + 2005-12-07 Paul Eggert * stat-time.m4 (gl_STAT_TIME): Add check for diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index 59d38e0750..86ae312d43 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -83,11 +83,15 @@ AC_DEFUN([AC_HEADER_STDBOOL], char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); #endif + _Bool q = true; + _Bool *pq = &q; ], [ + *pq |= q; + *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p); + + !m + !n + !o + !p + !q + !pq); ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) -- 2.47.3