On Sun, May 9, 2010 at 6:04 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Huh? We build just fine on C99 compilers, AFAIK. Or are you saying
> that we should try to adopt <stdbool.h>'s definition of bool? The
> problem there is, again, that we don't know what width that will be.
No, I'm saying we should use something like pgbool so that users can
compile code that uses stdbool.h in a c99 environment.
This would break any existing modules which use bool to refer to the
postgres bool. It wouldn't be hard to replace bool with pgbool in
those modules, and if they want to work with multiple versions of
postgres then they can add a #ifndef bool #define bool pgbool and be
It's hardly our highest priority but it seems a reasonable course
given that c99 is becoming quite standard. It's hardly as invasive as
what would be needed to be c++ safe. I'm not sure whether our include
files have an non-c99 inline uses which would be harder to deal with.
I don't see any other conflicts offhand that would create problems
using a c99 compiler to build server modules. It's quite annoying and
sad that they added "bool" to c99 since otherwise it would just be a
drop-in replacement with extra functionality and very low risk of
conflicts. Instead they virtually guaranteed conflicts with any large
software over a single define.
In response to
pgsql-bugs by date
|Next:||From: Takahiro Itagaki||Date: 2010-05-10 03:14:15|
|Subject: Re: BUG #5450: system lacked sufficient buffer space, or because a queue was full, could not perform the operation|
|Previous:||From: Bryan Henderson||Date: 2010-05-09 17:37:10|
|Subject: Re: bool: symbol name collision|