Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Watkins <awatkins1966(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message
Date: 2025-07-23 18:41:02
Message-ID: 1341739.1753296062@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Watkins <awatkins1966(at)gmail(dot)com> writes:
> You are right Solaris is missing "const"

> struct pam_conv {
> int (*conv)(int, struct pam_message **, struct pam_response **,
> void *);
> void *appdata_ptr;
> };

So I tried to replicate this issue on an OpenIndiana VM (OI 2024.04),
and got no failure. Digging into /usr/include/security/pam_appl.h,
I found the reason:

struct pam_conv {
#ifdef _PAM_LEGACY_NONCONST
int (*conv)(int, struct pam_message **,
#else
int (*conv)(int, const struct pam_message **,
#endif
struct pam_response **, void *);
void *appdata_ptr; /* Application data ptr */
};

So that's just annoying as all get-out: it means some "Solaris"
platforms do have this declaration with the "const", and even
there it's going to be dependent on compilation environment.

I still see a way to avoid a configure check though: let's make
src/include/port/solaris.h "#define _PAM_LEGACY_NONCONST".
That should make OpenIndiana enough like other Solaris-alikes
for the purpose, and we can also use that same symbol to cue
our code how to declare the callback function.

Or we could create a configure check, but that seems like a lot
of work, and it would add some extra time to everybody's build.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-07-23 19:47:06 Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message
Previous Message Tom Lane 2025-07-23 15:43:19 Re: BUG #18995: Building with GCC 14 fails: incompatible pointer struct pam_message