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.96) (envelope-from ) id 1vnfDx-009yG1-0r for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Feb 2026 15:55:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnfDv-00CGGv-12 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Feb 2026 15:55:23 +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.96) (envelope-from ) id 1vnfDu-00CGGn-39 for pgsql-hackers@lists.postgresql.org; Wed, 04 Feb 2026 15:55:22 +0000 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vnfDr-000000013GB-3Qgy for pgsql-hackers@lists.postgresql.org; Wed, 04 Feb 2026 15:55:22 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-7927b1620ddso381857b3.0 for ; Wed, 04 Feb 2026 07:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770220518; x=1770825318; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=o1WEV5w0/8aVZUY+Pcq32uFzOACNAbmIKTY/NgGncyE=; b=d4/YpRwmTrszam2+j+Il0em8l2EbVGFaAKkjmVjPk2/etcXEx1TiXX7I3NUVM9IriQ z5nYs4EMsrm+xuOc7IefakbWYP8H4aqOG6Ta06ev40Yf+kpE33/JGSYO+Kdd0v/uyuUF NhDc4LZXt5XbC0E/n9CtFUbfQejC42i2pSlC4duTKwKiQQSDMkRgZ8LgcNoU4sCHUSqO oiT5WglsxGfCWixb/sz4BaSBeNo5Lv2DeGqGhMGTQuodUWn1UOu7s3du0OKsuGPQivg9 ueCY1jZGoJqC78s78EUPLcAWvJxAKR/j308AUQX/IPk8gcP8uYIhJMWNMJbMN4iA3I8R J9sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770220518; x=1770825318; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o1WEV5w0/8aVZUY+Pcq32uFzOACNAbmIKTY/NgGncyE=; b=nViSouuR4NbWO1rQHRoJZ8esoI6rOuVt/6igY4sUd8fMqzd1qyOB2PZNzRaJpGYKzS t6DVDlvhz99jM5dmZ5W1LMWWgUrCgNejdUVnvqHeASV1Fwf0jGF0WZ+t9u5GG2cZUoNE VLnuwjXBaW9+KP4a7lKrpE0ADVFszMTAgx5uZUPqCO2qU2D8Fv0xQ70/lbPOryckrNJ6 Ky//8eyAyv7vXLFRy/u3lcmZ6FtQ06ZoAo6duMo2aObpbLk8oDNgKgFbcOioD0OdBmrh ixLDapvO2i5F5/h96LNXfOj8z6isMA0IXFiWZx3RaQKgVmB8Cq7z74RyXgWCI05zMa2v Pyxw== X-Gm-Message-State: AOJu0YyUHoPfTFB84j9NoFsMP0IAToi+WLVKfprQEgSQvAPw3Jw6Nt8M ZikpGx7W/PLuqlnCr/1Q+hAy312NzunnBBzQVVQYG9q4dhXFBSsojL+VBjoVRM9P X-Gm-Gg: AZuq6aLpl6Xbtu8i8pyi5k1IJvxVq+dbFdBNsRE4qy2Z66x7j10FlIb7yE3JaJW4/m3 fiayA019rnIbUpanDXMsslPzokCifLg61065n7k1vxfXuUBGpBk6pWuLlQMmw6xaiH6+WBancfC w5Alb7rTyk4DP9ko4v9W4q/M1qPslZIr6GZyQqxXZQBLDopbPtnhKiY+K8rd8PLLM6ojRmfUWeR 95gwxiVJVg8A1zINDCa5rFIzGERFxjZOa0NW40HzKGfMaTp8vqfLZ1WQ5NVFvsXcNPvDBd74LIX GWVYbvKCQdG5c9okh2ZSp/xePurrNk5HaSrswIatxI0n/cbYiYABEVI5py7lmCHPRecunNL1O7m 14gqwphvC3rh4OqeLLB4Dci4uzbTa7gmyFOvv8mjc85cIw5UC7fqf5RjwoSWwzLrw89gJE29MK0 zgU1B0swsfp3o2XhEPQISM7Dp+ls+eu+WNWMAXUSo8zCDWHYdI/Ce04UcGdmqfbtGx X-Received: by 2002:a05:690c:61c8:b0:795:b32:ead5 with SMTP id 00721157ae682-7950b32f594mr11409697b3.34.1770220517545; Wed, 04 Feb 2026 07:55:17 -0800 (PST) Received: from ?IPV6:2600:1700:8952:80:85b0:65cf:d1fd:c46a? ([2600:1700:8952:80:85b0:65cf:d1fd:c46a]) by smtp.gmail.com with ESMTPSA id 00721157ae682-794feec8c08sm24118007b3.22.2026.02.04.07.55.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Feb 2026 07:55:16 -0800 (PST) Message-ID: Date: Wed, 4 Feb 2026 09:54:37 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Make copyObject work in C++ To: pgsql-hackers@lists.postgresql.org References: <4d8b9e53-3f37-43f0-a4aa-5bda9c7961b3@eisentraut.org> <4e82f77b-acad-4356-94f6-8255135fb36b@eisentraut.org> Content-Language: en-US From: Bryan Green In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/25/2026 6:42 AM, Jelte Fennema-Nio wrote: > On Tue Jan 20, 2026 at 5:28 PM CET, Peter Eisentraut wrote: >> I have split your first patch further.  For a start, I left out the >> PG_MODULE_MAGIC*-related changes and disabled the module under MSVC. >> This has been committed.  I plan to let the buildfarm run with it for >> a day or two and then add in the basic MSVC support. > > To hopefully make your life a bit easier. Here's a rebased version that > enables the MSVC support again, with an updated commit message. > This causes the build to break on VS 2022. Versions prior do not have support for __typeof_unqual__. This would have led to HAVE_TYPEOF_UNQUAL being not defined on the buildfarm causing the fallback to copyObjectImpl() for VS 2019. When you build on VS 2022 you will get an error: ../src/backend/commands/event_trigger.c(1901): error C2100: you cannot dereference an operand of type 'void' VS 2022 (MSVC) does not handle the void * dereference the way gcc/clang does (thanks to GNU extensions, I believe). It exposes __typeof_unqual__ even it C11, but enforces strict C semantics on the void * dereference. To work on this platform the call copyObject(lfirst(cell)) would need to have a cast to the correct concrete type: copyObject((Node *)lfirst(cell)). I was about to update to VS 2026, but now I think I should have an instance of VS from 2019, 2022, and 2026. -- Bryan Green EDB: https://www.enterprisedb.com