pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
A build failure since only include header "postgresql/server/port.h"
2+ messages / 2 participants
[nested] [flat]

* A build failure since only include header "postgresql/server/port.h"
@ 2024-03-06 08:51  Changqing Li <changqing.li@windriver.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Changqing Li @ 2024-03-06 08:51 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: Changqing Li <changqing.li@eng.windriver.com>

Hi,

I am building pgpool2, and there is  a snprintf.c,  which use 
PG_STRERROR_R_BUFLEN, so I include header "postgresql/server/port.h".

It works well before.  but after I upgrade postgresql from 15.5 to 
16.2,  I will met following error:

usr/include/postgresql/server/port.h:488:28: error: a parameter list without types is only allowed in a function definition
   488 | typedef void (*pqsigfunc) (SIGNAL_ARGS);
       |                            ^

Since commit 
https://github.com/postgres/postgres/commit/b66fbd8afe6eb80e3e48495e002fda9aa92df583#diff-c6b9d5a7f7..., 


SIGNAL_ARGS is used in port.h, it is defined in c.h,  But port.h don't 
include c.h, and cause above error.   Should we include c.h in port.h?

I also tried include c.h in port.h,   but met another error when 
building pgpool2.  I also reported this to pgpool2 community: 
https://www.pgpool.net/mantisbt/view.php?id=830


Could you help to give an suggestion about how to fix this issue?


Thanks

Changqing

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: A build failure since only include header "postgresql/server/port.h"
@ 2024-03-06 15:18  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Changqing Li <changqing.li@windriver.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-03-06 15:18 UTC (permalink / raw)
  To: Changqing Li <changqing.li@windriver.com>; +Cc: pgsql-bugs@lists.postgresql.org, Changqing Li <changqing.li@eng.windriver.com>

Changqing Li <changqing.li@windriver.com> writes:
> SIGNAL_ARGS is used in port.h, it is defined in c.h,  But port.h don't 
> include c.h, and cause above error.   Should we include c.h in port.h?

No, absolutely not.  The expectation in all PG header files is that
the .c file included one of postgres.h, postgres_fe.h, or c.h to
begin with (mainly to establish whether this file is backend code,
frontend code, or intended to work as both).  This is your error
not port.h's.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-03-06 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 08:51 A build failure since only include header "postgresql/server/port.h" Changqing Li <changqing.li@windriver.com>
2024-03-06 15:18 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox