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 1u0omX-008Tjd-0e for pgsql-committers@arkaria.postgresql.org; Fri, 04 Apr 2025 21:40:57 +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 1u0omV-005GnW-Ex for pgsql-committers@arkaria.postgresql.org; Fri, 04 Apr 2025 21:40:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u0omU-005GnN-LM for pgsql-committers@lists.postgresql.org; Fri, 04 Apr 2025 21:40:55 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u0omS-002zKq-0c for pgsql-committers@lists.postgresql.org; Fri, 04 Apr 2025 21:40:53 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 146281140174; Fri, 4 Apr 2025 17:40:51 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Fri, 04 Apr 2025 17:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1743802851; x=1743889251; bh=/ CPzkKpE03Mi5NkfHfa8EmwYaBCRDuBXGnfSzEaQgBw=; b=RR8mTufKufQcGpz6K gpdgMq18p4P4adfCHSqYoOLQCxiK+MQnhMboR70I74VCVItzs1bkYVne8CwlEQmf ryb0mQUO2s2AOgkZjiSxHyL6IPcjGH4yNNuthuqRNI4gf1iTDWlUeGVdjEPE+DTt mr0Q4WDL8caZvOjsb/JfanistXgA1gOXe/N2mo1ISHfkv3dqtHbjkj0SzmNw16cx ulkMjbrBeTYPxufy40kQGzne2a5R5qYJs3JwRcs/4PVbqKV1vwDRO9JIias6uBNb 4fcemLTm5jwK+RBfc2Um8jWLZxcJogMYEl4n24FXXXNUWxFBDRnH26w1nfhD9iVq Ta1aQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduledvheegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesmhekreertddt jeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepieejvddugeegfeelleeh ffeiheelhfduuefftdehgeeuudejuddvgeetfffhffeunecuffhomhgrihhnpegvnhhtvg hrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsg gprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpghhsqhhl qdgtohhmmhhithhtvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtg hpthhtohepnhgrthhhrghnsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Apr 2025 17:40:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1743802848; bh=IeKEIz85aHyFmUFzXEhwAVe73oCfY7NlVF1MQ7P/lJ8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=UD2yBttTCqOUMs7u12CuXZAYv89ChdXeeFIZtFgK+UhVRBx7Xe8yC+n4bP3D4P5h+ nCxVXykBTAnEWtUG0aN2LUh4L7Gjd6Jy5SWGHW5mA3C+z+1vQVzlAGvgWbEqeLMPNd IoKviFJP0Y3NOwBFvNoOgc08r7TJ6y3m7hIJg/KWo/W/kuZWT8w//1WUPf97uQdtHI y95wriSVVjPTbKZ0DOj4Uo62zFiquG5jx1kWa3V0NhJpTZdFYLd1I/D2O4BDeT01u2 xX7QES7mxUOTmbhsoDMtbsqCAaffkipOhAJdhFyOBvn5ytub0t1yqy2Tex8Nt9lKEv s3Im/hGE5ZNBg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 0B81D8E; Fri, 4 Apr 2025 23:40:48 +0200 (CEST) Date: Fri, 4 Apr 2025 23:40:48 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Nathan Bossart Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Prevent redeclaration of typedef TocEntry. Message-ID: <202504042140.qo66ggw6wzsz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="65xecd5n6aqglpli" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --65xecd5n6aqglpli Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2025-Apr-04, Nathan Bossart wrote: > Prevent redeclaration of typedef TocEntry. > > Commit 9c02e3a986 added a forward declaration for this typedef that > caused redeclarations, which is not valid in C99. To fix, add some > preprocessor guards to avoid a redefinition, as is done elsewhere > (e.g., commit 382092a0cd). Hmm, I have the impression that this results from some very old untidyness in the pg_dump headers in general. The fact that DataDumperPtr is in pg_backup.h seems now more of an accident than something we would really choose to do nowadays -- it's been that way since pg_dump was introduced in commit 500b62b0570f apparently. I'm sure there were good reasons to have it there then. But we've restructured the pg_dump headers at least once, and as far as I can see there aren't anymore. AFAICS we could move both DefnDumperPtr and DataDumperPtr typedefs to pg_backup_archiver.h, together with struct _tocEntry (the only place where they are used), and we'd have less of a mess here. Then we don't need struct TocEntry in pg_backup.h anymore. Plus, these function typedefs aren't really "public interface" for pg_dump anyway (which is what pg_backup.h claims to be), so I think it would be a sensible cleanup. Patch attached. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest "foo" someone someday shall type "supercalifragilisticexpialidocious" (5th Commandment for C programmers) --65xecd5n6aqglpli Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-cleanup-pg_dump-headers-a-bit.patch"