[Nagiosplug-devel] usage of the bool type
Ton Voon
ton.voon at altinity.com
Mon Jun 4 11:36:00 CEST 2007
On 3 Jun 2007, at 19:01, Holger Weiss wrote:
> * Matthias Eble <matthias.eble at mailing.kaufland-
> informationssysteme.com> [2007-06-02 14:10]:
>> I was just wondering, why the bool type is never used in the plugin
>> code.
>
> The "bool" type was introduced with C99, so it doesn't (necessarily)
> exist on older platforms.
>
>> The only occurrence is in changes I made (two flags in check_disk).
>
> I don't really care whether or not we use the "bool" type, but IMO we
> should either use it everywhere or nowhere for consistency. If we use
> it, we must check for the existence of <stdbool.h> via Autoconf (which
> we do already) and make sure to #include code such as the following in
> every file which uses "bool", "true" or "false" (see gl/stdbool_.h):
>
> [snipped]
Since bool is available from gnulibs, support on all platforms should
be possible, so that shouldn't be a deciding factor.
I don't have an opinion on whether we should use it, but I agree with
Holger that we should be consistent. However, if we choose to use
bool, that doesn't mean we have to do it all at once - I'm happy if
you want to prove it works in one plugin, change a few more and we
make a note in the dev guidelines to use bool when possible.
Ton
http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon
More information about the Devel
mailing list