From: | Christof Petig <christof(at)petig-baender(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, mscott(at)sacadia(dot)com, Hackers List <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: C++ Headers |
Date: | 2001-05-21 09:01:01 |
Message-ID: | 3B08D94D.AE828050@petig-baender.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > The only mention I see of this is in c.h:
>
> > #ifndef __cplusplus
> > #ifndef bool
> > typedef char bool;
>
> > #endif /* ndef bool */
> > #endif /* not C++ */
>
> > If you need more cplusplus stuff, lets figure it out and add it.
>
> Actually, that portion of c.h is a time bomb that is likely to blow up
> in the face of some poor C++ user. There's no guarantee that a C++
> compiler's built-in bool type will be compatible with "char", is there?
> If it happened to be, say, same size as "int", then a C++ module
> would interpret lots of things differently from a C module.
This in fact has happened within ECPG. But since sizeof(bool) is passed to
libecpg it was possible to figure out which 'bool' is requested.
Another issue of C++ compatibility would be cleaning up the usage of
'const' declarations. C++ is really strict about 'const'ness. But I don't
know whether postgres' internal headers would need such a cleanup. (I
suspect that in ecpg there is an oddity left with respect to host variable
declaration. I'll check that later)
Christof
From | Date | Subject | |
---|---|---|---|
Next Message | Gabor Csuri | 2001-05-21 10:27:43 | I don't understand... |
Previous Message | Tom Lane | 2001-05-21 04:32:42 | Re: Plans for solving the VACUUM problem |