Eric Blake <[EMAIL PROTECTED]> writes: > If it is getting the gnulib bool, then we should figure out how to > make the gnulib bool pick a type that will work for this usage > pattern.
I don't know any way to do this. 'bool' must promote to int, so the only plausible candidates that can be used for bit-fields are int and signed int. But bool bitfields have a value 0 or 1, whereas a signed bitfield has the value 0 or -1 (on two's complement hosts). Admittedly this problem should be documented. Here's a proposed patch. 2007-02-04 Paul Eggert <[EMAIL PROTECTED]> * lib/stdbool_.h: Mention that bool bit-fields aren't supported. --- lib/stdbool_.h.~1.10.~ 2006-01-26 05:31:49.000000000 -0800 +++ lib/stdbool_.h 2007-02-04 09:53:04.000000000 -0800 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. Written by Bruno Haible <[EMAIL PROTECTED]>, 2001. This program is free software; you can redistribute it and/or modify @@ -41,6 +41,9 @@ - You cannot assume that _Bool is a typedef; it might be a macro. + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + - In C99, casts and automatic conversions to '_Bool' or 'bool' are performed in such a way that every nonzero value gets converted to 'true', and zero gets converted to 'false'. This doesn't work _______________________________________________ M4-discuss mailing list M4-discuss@gnu.org http://lists.gnu.org/mailman/listinfo/m4-discuss