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 1t0RhH-00BTi6-Ab for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 20:29:43 +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 1t0RhF-00H2qt-Bd for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 20:29:41 +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 1t0RhF-00H2ql-1d for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 20:29:41 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t0RhB-00143z-NB for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 20:29:40 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3a3bd42955bso10248425ab.1 for ; Mon, 14 Oct 2024 13:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728937777; x=1729542577; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gXE7dUJAm47z78S5s2eQk5d+CjRDDpnkrV5+5FR2vK4=; b=gjBc4gPLG/jSyCoZCTK9YqThfYWpFXaHLDe8iLwpQ/sWTCuEz+2KeiWfXvzCwPs7n0 xDBEE4Mevc1Uj/9i3nEEmyqGX94BB4ZHBL2Xl+RQjqDtA3I7NbhfToVZ8JXvxWM7gfd7 tKT8KDZx+D2yRUZugRpo8+4OYKzd1wyJtqnoNz27Pwm79cqbibQ4RuaD3TpPwSpUbWA3 1zVKTGHiffBWAgEzO5Y3K6r4IwuBrpM5cAuygD7RmlJxmqmR7ptlNTx3r1mPQ43il6zV F8M7eo+Nz+6Emncg6k9QkOPMtY/7cMr0ER1+xu/Xel9yP8ybWiFb7gvJ3PuNtQSI88Qg CPUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728937777; x=1729542577; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gXE7dUJAm47z78S5s2eQk5d+CjRDDpnkrV5+5FR2vK4=; b=gjkQsK7r5g0fM6SybNdd2avjSj0HKeTd5ttxXp5RfjqzKi5KM+UHjgZaM0Tj5rNU55 2Ffn426n4Z0I4N+YgK8HXIH11nVABr9EMBWBHLb+B6llHcyxwag5g/ZpYTylG7+hWODZ oaTIvRXzDVrNH29ZNXBvBaMSZilX5OzsF/ma8DYydSQUm8oDpFuFyQsibdccplo8uk7w 8CzOtg8UhdrHoKO/xCXknU4q4bmLIXA5FfnS6aoPKpPzajQlP/pCLBAk+6Cakq62qz5K ufFbc5BP6Ly+yp4ryoB/jg6xhywIU8lH4s2FvpgHZA+Uum1mLVXLNfDSeEexNFnUsWiI pUsQ== X-Gm-Message-State: AOJu0YyYRRPMAyGFm6p30G45vCdW4j11T2E5+jRjeG5TOaw1XfuQLlNF 2+Fm0/enA0F2bUPCqmXJ9OXBBY0+NMOTLNUwFNtlO9l10l6sb/29uOq6Fg== X-Google-Smtp-Source: AGHT+IEJkU3Vu0lUvBAhi2wc8nXsBdonRo8YDkWmNTpZ3dUFfXVHHu8dhcUac+6SHZl+/mtiBCx3BQ== X-Received: by 2002:a05:6e02:12cc:b0:3a3:983a:872f with SMTP id e9e14a558f8ab-3a3b5fce83bmr107038045ab.24.1728937776650; Mon, 14 Oct 2024 13:29:36 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a3afde8e53sm62346015ab.82.2024.10.14.13.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 13:29:35 -0700 (PDT) Date: Mon, 14 Oct 2024 15:29:34 -0500 From: Nathan Bossart To: Jelte Fennema-Nio Cc: PostgreSQL Hackers Subject: Re: Make foreach_ptr macro work in C++ extensions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 14, 2024 at 10:05:42PM +0200, Jelte Fennema-Nio wrote: > I've been writing a C++ extension recently and it turns out that the > foreach_ptr macro added in PG17 by one of my patches causes a > compilation failure when used in C++. This is due to C++ its stricter > rules around implicit casts from void pointers. Whoops. > Attached is a tiny patch that fixes that by adding an explicit cast to > the macro. Looks reasonable to me. > I think it would be good to backpatch this to PG17 as well, > as to not introduce some differences in the macro across versions. I'd consider this a "low-risk" fix, which our versioning page [0] says is acceptable for a minor release, so I'll plan on back-patching unless someone objects. [0] https://www.postgresql.org/support/versioning/ -- nathan