Re: BUG #18026: compile error / fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this function)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marcel Hofstetter <hofstetter@jomasoft.ch>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-07-17T20:42:47Z
Lists: pgsql-bugs
Marcel Hofstetter <hofstetter@jomasoft.ch> writes: > I found it fails after > ./configure --prefix /usr/local/16-pgsql --without-icu > but compiles with > ./configure --prefix /usr/local/16-pgsql --without-icu --with-openssl Ah. Further digging shows that: * On Linux, macOS, and NetBSD (probably all *BSD), <limits.h> is included by <sys/param.h>, which fe-auth.c includes. So that explains why we didn't see a problem most places, regardless of compile options. AFAICT <sys/param.h> is not specified by POSIX, so it's unsurprising if Solaris has a different idea of what it should expose. * The openssl headers #include <limits.h> from ossl_typ.h, which is pulled in indirectly from most other openssl headers. So that's why margay didn't complain. So I'm now satisfied that the problem is explained, and I'll go put in the needful #include. Thanks for the report! regards, tom lane
Commits
-
Include <limits.h> in fe-auth.c, to get CHAR_BIT reliably.
- efe8d8226929 16.0 landed
- 8fab4b348013 17.0 landed