]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(_Bool): Make it signed char, instead of
authorJim Meyering <jim@meyering.net>
Mon, 28 Jul 2003 08:30:32 +0000 (08:30 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 28 Jul 2003 08:30:32 +0000 (08:30 +0000)
an enum type, so that it's guaranteed to promote to int.

lib/stdbool.hin

index 69f6ef725fe3c76c80d7716141d4b083dc79c265..f84c69fdd8d4fabf66252514c31188e64fca8a05 100644 (file)
 # undef true
 #endif
 
-/* For the sake of symbolic names in gdb, define _Bool as an enum type.  */
+/* 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.  */
 #ifndef __cplusplus
 # if !@HAVE__BOOL@
-typedef enum { false = 0, true = 1 } _Bool;
+enum { false = 0, true = 1 };
+typedef signed char _Bool;
 # endif
 #else
 typedef bool _Bool;