Extend the comment.
authorBruno Haible <bruno@clisp.org>
Tue, 5 Aug 2003 19:29:51 +0000 (19:29 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Aug 2003 19:29:51 +0000 (19:29 +0000)
lib/stdbool_.h

index 0334cd9fcffe5603bca1673b2663dc410aa98a2b..52d224bfde06b3f6c5b8b5795a3a2d3fb1297841 100644 (file)
 # 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 };