From 99f5508d3fb3b5902083a6d043f251d21b2cf01c Mon Sep 17 00:00:00 2001 From: drl7x Date: Thu, 6 Mar 2003 05:58:07 +0000 Subject: [PATCH] Added support for the _Bool type This time I out it in standard.h. I'm not sure why we have ansi.h and standard.h --- lib/ansi.h | 23 ++++++++++++++++++++++- lib/standard.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/lib/ansi.h b/lib/ansi.h index add8f09..524356c 100644 --- a/lib/ansi.h +++ b/lib/ansi.h @@ -1253,7 +1253,8 @@ typedef /*@unsignedintegraltype@*/ uintmax_t; /*@constant size_t INTPTR_MIN@*/ /*@constant size_t INTPTR_MAX@*/ -/*drl added the __func__ identifier from C99 +/*drl 3/5/2003 + added the __func__ identifier from C99 This won't follow the same semantics as __func__ in C99 @@ -1266,3 +1267,23 @@ typedef /*@unsignedintegraltype@*/ uintmax_t; an arbitary value. */ static const char _ _func_ _[] = "function-name"; + + +/* drl 3/5/2003 + added limited supported for _Bool */ + +/*__Bool shouled really be a basic type but edited the grammar and ripping + apart the rest of Splint would probably break too much stuff... +*/ + +typedef /*@unsignedintegraltype@*/ _Bool; + +/*support stdbool.h */ + +#define bool _Bool + +#define true 1 + +#define false 0 + +#define __bool_true_false_are_defined 1 diff --git a/lib/standard.h b/lib/standard.h index 6623d8b..4a85e00 100644 --- a/lib/standard.h +++ b/lib/standard.h @@ -1252,3 +1252,42 @@ typedef /*@unsignedintegraltype@*/ uintmax_t; /*@constant size_t INTPTR_MIN@*/ /*@constant size_t INTPTR_MAX@*/ + +/*drl 3/5/2003 + added the __func__ identifier from C99 + This won't follow the same semantics as + __func__ in C99 + + FWIW C99 says that __func__ should have the value of the + lexically enclosing function + e.g. in the function foo __func__ == "foo" + in bar __func__ == "bar" + + We're just having the value be constant here and picking + an arbitary value. +*/ +const char __func__[] = "function-name"; + + +/* drl 3/5/2003 + added limited supported for _Bool */ + +/*__Bool shouled really be a basic type but edited the grammar and ripping + apart the rest of Splint would probably break too much stuff... +*/ + +typedef /*@unsignedintegraltype@*/ _Bool; + +/*support stdbool.h */ + +typedef _Bool bool; + +//#define bool _Bool + +/*@constant _Bool true=1@*/ +#define true 1 + +/*@constant _Bool false=0@*/ +#define false 0 + +#define __bool_true_false_are_defined 1 -- 2.45.0