Re: bool: symbol name collision

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alex Hunsaker <badalex(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bryan Henderson <bryanh(at)giraffe-data(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: bool: symbol name collision
Date: 2010-05-12 12:08:22
Message-ID: AANLkTinM9e7g4rYXFI85eLFF4CPD1QUG5Vb_k4gOD9Lm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, May 12, 2010 at 1:01 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> The problem with the bool type is that it could have different sizes on
> different systems.  Which will lead to problems.  I doubt that that
> problem exists with int4.
>

I could imagine macros that do the wrong thing if the types they use
inside them have the wrong signedness...

I tihnk the reasons bool is particularly eggregious are a) we have
these misleading #ifdefs that don't do the right thing and b) there's
a stdbool.h making it hard for c99 programmers to avoid doing the
wrong thing. The other types are part of the postgres server interface
and module writers should just avoid redefining them -- if they do
they'll get errors. I think it would be nice to make that better but
at least they won't be silently redefining the postgres interfaces to
potentially incorrect definitions.

--
greg

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-05-12 13:47:42 Re: bool: symbol name collision
Previous Message Peter Eisentraut 2010-05-12 12:01:51 Re: bool: symbol name collision