changeset 4505:b1f54c9110c6

Extend the comment.
author Bruno Haible <bruno@clisp.org>
date Tue, 05 Aug 2003 19:29:51 +0000
parents 66dca1409f3e
children df8611a33210
files lib/stdbool_.h
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib/stdbool_.h
+++ b/lib/stdbool_.h
@@ -29,10 +29,14 @@
 # undef true
 #endif
 
-/* For the sake of symbolic names in gdb, define true and false as
-   enum constants.  However, do not define _Bool as the enum type,
-   since the enum type might be compatible with unsigned int, whereas
-   _Bool must promote to int.  */
+/* For the sake of symbolic names in gdb, we define true and false as
+   enum constants, not only as macros.
+   It is tempting to write
+      typedef enum { false = 0, true = 1 } _Bool;
+   so that gdb prints values of type 'bool' symbolically. But if we do
+   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
+   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+   (see ISO C 99 6.3.1.1.(2)).  */
 #ifndef __cplusplus
 # if !@HAVE__BOOL@
 enum { false = 0, true = 1 };