Re:PostgreSQL 10.2 Released
by pritambaral on Friday February 09, 2018 @03:04PM
(#16343404)
> But seriously, the thing that hurts more is that we only require a C89 compiler :/
Indeed. For a glimpse for the non-PG-hackers (like me), there's an ongoing attempt discussed in the PG-hackers mailing list to use stdbool.h.
That can be tricky because you can't emulate the semantics of the C99 bool type.
In C99
(bool)256 == 1
but on systems which emulate bool with, e.g., an 8-bit unsigned char then (bool)256 == 0
Re:PostgreSQL 10.2 Released
by petereisentraut on Friday February 09, 2018 @05:26PM
(#16344403)
Another problem is that the bool provided by stdbool.h is 4 bytes on some platforms, which breaks PostgreSQL all over the place.
I work on PG, and I'm regularly astounded too...
As long as the compilers are new enough, the burden isn't too high though. Previously it prevented us from using atomics for some concurrency optimized things, but now we've an atomics implementation that, at compile time, falls back to a spinlock backed atomics implementation. Slightly complicated by the fact that we don't even have a hard dep on a spinlock implementation, falling back to semaphores :)
Ah. Fun.
But seriously, the thing that hurts more is that we only require a C89 compiler :/