Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v2sUp-008Ljs-9N for pgsql-hackers@arkaria.postgresql.org; Sun, 28 Sep 2025 14:35:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v2sUm-00Eijd-QE for pgsql-hackers@arkaria.postgresql.org; Sun, 28 Sep 2025 14:35:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v2sUm-00EijU-HE for pgsql-hackers@lists.postgresql.org; Sun, 28 Sep 2025 14:35:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v2sUk-000YUU-2e for pgsql-hackers@postgresql.org; Sun, 28 Sep 2025 14:35:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 58SEZJpT832525; Sun, 28 Sep 2025 10:35:19 -0400 From: Tom Lane To: =?UTF-8?Q?=C3=81lvaro_Herrera?= cc: "Peter Eisentraut" , pgsql-hackers Subject: Re: allow benign typedef redefinitions (C11) In-reply-to: References: <10d32190-f31b-40a5-b177-11db55597355@eisentraut.org> Comments: In-reply-to =?UTF-8?Q?=C3=81lvaro_Herrera?= message dated "Sun, 28 Sep 2025 11:23:51 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <832523.1759070119.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 28 Sep 2025 10:35:19 -0400 Message-ID: <832524.1759070119@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?Q?=3DC3=3D81lvaro_Herrera?=3D writes: > The changes to inet.h and varbit.h are surprising, but required. Why? Those headers compile now, and you've not removed any includes that they might indirectly depend on. > (It's possible that we should be including varatt.h in more datatype hea= ders than just those two, but at least these are the ones that complained.= So another option would be to include varatt.h in the files that include= those headers. However, that seems to me to be the wrong direction). If what you mean is that some of the macros in these headers require varatt.h to be used, I do not agree that that means we should put varatt.h into these headers. We've frequently relied on exactly that property of macro definitions to avoid excessive or circular inclusions. Moreover, even if we wanted to change that policy, I know of no simple way to check it. Furthermore, this whole business of using "typedef struct foo foo;" to avoid including foo.h is predicated on the assumption that the ultimate consumer (some .c file) will itself include foo.h, because otherwise it's most likely gonna have problems with the incomplete typedef. So changing the rules about macros seems to me to be going in quite the wrong direction. I think what we're trying to do here is reduce the #includes of header files to be just enough to compile the headers themselves. That will bleed out into more #include's required in .c files, but that's fine by me. regards, tom lane