BUG #18026: compile error / fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this function) - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18026: compile error / fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this function)
Date
Msg-id 18026-d5bb69f79cd16203@postgresql.org
Whole thread Raw
Responses Re: BUG #18026: compile error / fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this function)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18026
Logged by:          Marcel Hofstetter
Email address:      hofstetter@jomasoft.ch
PostgreSQL version: 16beta2
Operating system:   Solaris 11.4 SPARC
Description:

...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Werror=vla -Wendif-labels -Wmissing-format-attribute
-Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-Wno-format-truncation -Wno-stringop-truncation -O2
-D_POSIX_PTHREAD_SEMANTICS -pthread -D_REENTRANT -D_THREAD_SAFE -fPIC -I.
-I../../../src/include  -D_POSIX_PTHREAD_SEMANTICS  -I../../../src/port
-I../../../src/port -DSO_MAJOR_VERSION=5  -c -o fe-auth.o fe-auth.c
In file included from ../../../src/include/postgres_fe.h:25,
                 from fe-auth.c:23:
fe-auth.c: In function 'check_expected_areq':
fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this
function)
  807 |         StaticAssertDecl((sizeof(conn->allowed_auth_methods) *
CHAR_BIT) > AUTH_REQ_MAX,
      |
^~~~~~~~
../../../src/include/c.h:914:24: note: in definition of macro
'StaticAssertDecl'
  914 |         _Static_assert(condition, errmessage)
      |                        ^~~~~~~~~
fe-auth.c:43:1: note: 'CHAR_BIT' is defined in header '<limits.h>'; did you
forget to '#include <limits.h>'?
   42 | #include "fe-auth.h"
  +++ |+#include <limits.h>
   43 | #include "fe-auth-sasl.h"
In file included from ../../../src/include/postgres_fe.h:25,
                 from fe-auth.c:23:
fe-auth.c:807:64: note: each undeclared identifier is reported only once for
each function it appears in
  807 |         StaticAssertDecl((sizeof(conn->allowed_auth_methods) *
CHAR_BIT) > AUTH_REQ_MAX,
      |
^~~~~~~~
../../../src/include/c.h:914:24: note: in definition of macro
'StaticAssertDecl'
  914 |         _Static_assert(condition, errmessage)
      |                        ^~~~~~~~~
fe-auth.c:807:26: error: expression in static assertion is not an integer
  807 |         StaticAssertDecl((sizeof(conn->allowed_auth_methods) *
CHAR_BIT) > AUTH_REQ_MAX,
      |                          ^
../../../src/include/c.h:914:24: note: in definition of macro
'StaticAssertDecl'
  914 |         _Static_assert(condition, errmessage)
      |                        ^~~~~~~~~
gmake[3]: *** [<builtin>: fe-auth.o] Error 1


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query returns error "there is no parameter $1" but server logs that there are two parameters supplied
Next
From: Tom Lane
Date:
Subject: Re: BUG #18026: compile error / fe-auth.c:807:64: error: 'CHAR_BIT' undeclared (first use in this function)