summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-07-28 08:30:32 +0000
committerJim Meyering <jim@meyering.net>2003-07-28 08:30:32 +0000
commit8b70bf19ab4636ceec828b7678a3abf82652ab0c (patch)
treeafee314f84568e57b66670261ac875eb500986c1 /lib
parenta3fba24479f23a438dd775ee674f5368cab7f809 (diff)
downloadcoreutils-8b70bf19ab4636ceec828b7678a3abf82652ab0c.tar.xz
(_Bool): Make it signed char, instead of
an enum type, so that it's guaranteed to promote to int.
Diffstat (limited to 'lib')
-rw-r--r--lib/stdbool.hin8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdbool.hin b/lib/stdbool.hin
index 69f6ef725..f84c69fdd 100644
--- a/lib/stdbool.hin
+++ b/lib/stdbool.hin
@@ -29,10 +29,14 @@
# 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;