Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message
Date
Msg-id 1313566.1753280855@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message
Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> First, PostgreSQL 17.5 with GCC v13 builds cleaning and runs on Solaris
> 11.4, but building with GCC v14 I get the following:

> gcc -m64 -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 -I../../../src/include  -D_POSIX_PTHREAD_SEMANTICS
> -I/usr/include/libxml2   -c -o auth.o auth.c
> auth.c:101:9: error: initialization of 'int (*)(int,  struct pam_message **,
> struct pam_response **, void *)' from incompatible pointer type 'int
> (*)(int,  const struct pam_message **, struct pam_response **, void *)'
> [-Wincompatible-pointer-types]
>   101 |         &pam_passwd_conv_proc,
>       |         ^
> auth.c:101:9: note: (near initialization for 'pam_passw_conv.conv')

This doesn't look like a GCC version problem, but like a discrepancy
in the PAM header files, to wit, "const" or not in the expected
signature of pam_passwd_conv_proc.  Can you verify whether or not
pam_appl.h and its subsidiary headers changed?

On my Linux box I find this in /usr/include/security/_pam_types.h:

struct pam_conv {
    int (*conv)(int num_msg, const struct pam_message **msg,
        struct pam_response **resp, void *appdata_ptr);
    void *appdata_ptr;
};

but it seems that "const" is missing in yours.  I guess an alternative
theory is that it was inconsistent all along but you hadn't previously
tried to build --with-pam.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Shlok Kyal
Date:
Subject: Re: BUG #18897: Logical replication conflict after using pg_createsubscriber under heavy load
Next
From: Tom Lane
Date:
Subject: Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message