← Back to team overview

maria-developers team mailing list archive

Re: TRUE vs true (was: [Commits] ac05f41: postreview fix)



According to MySQL coding guidelines:

* In C code, use TRUE and FALSE rather than 1/0

* In C++ code, it is OK to use true and false (do not use 1/0). You can use C++
  bool/true/false when calling C functions (values will be safely promoted to

I'm aware of only one more or less good reason for not using true/false in C++:
it's easier to convert it to C code. But that's rare: we mostly convert in the
opposite direction.

Also C99 now supports true/false, e.g. see nice description:


On Thu, Apr 23, 2015 at 09:33:07AM +0200, Oleksandr Byelkin wrote:
> Hi, Jan!
> On 23.04.15 08:38, Jan Lindström wrote:
> >Sanja,
> >
> >Why you use TRUE/FALSE instead of true/false for bool ?
> Historical reasons. I was told to use TRUE/FALSE long time ago and nobody
> have told something else. We have no our code style doc so I use what I
> remember from old MySQL one.
> [skip]
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-developers
> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-developers
> More help   : https://help.launchpad.net/ListHelp

Follow ups