Re: headerscheck: Avoid mutual inclusion of pg_config.h and c.h - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: headerscheck: Avoid mutual inclusion of pg_config.h and c.h
Date
Msg-id 9c73b586-296f-4909-af95-9c27c1c251ea@eisentraut.org
Whole thread Raw
In response to headerscheck: Avoid mutual inclusion of pg_config.h and c.h  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On 23.03.26 09:50, Peter Eisentraut wrote:
> Headers that c.h includes early should not have another header included 
> before them in the headerscheck test file, especially not c.h.
> 
> A particular instance of a problem is that pg_config.h defines some 
> symbols that c.h later undefines in some cases, such as in the code 
> added by commit cd083b54bd67, but there were also some before that. This 
> only works correctly if pg_config.h is included first.
> 
> This problem can currently be observed on CI.
> 
> pg_config_manual.h and pg_config_os.h are closely related to pg_config.h 
> and should be treated the same way.
> 
> postgres_ext.h is meant to be usable standalone, so testing it with c.h 
> included first defeats the point.
> 
> c.h also includes port.h, but this patch leaves that alone, since port.h 
> does need some of c.h to be processed first.  (But because of header 
> guards, testing port.h separately is probably ineffective.)

This has been committed.




pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Bug: wrong relname in RemoveSubscriptionRel() error detail
Next
From: Yura Sokolov
Date:
Subject: Re: BM_IO_ERROR flag is lost in TerminateBufferIO due to order of operations in UnlockBufHdrExt