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 1wBZ2K-001Ayv-2o for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 14:10:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBZ2G-00GgAJ-1h for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Apr 2026 14:10:09 +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 1wBZ2G-00Gg6g-0j for pgsql-hackers@lists.postgresql.org; Sat, 11 Apr 2026 14:10:09 +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.98.2) (envelope-from ) id 1wBZ29-00000000WSX-1uzE for pgsql-hackers@postgresql.org; Sat, 11 Apr 2026 14:10:03 +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 63BE9wx9419717; Sat, 11 Apr 2026 10:09:58 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: some extra warnings from MSVC In-reply-to: <1142ad86-e475-41b3-aeee-c6ad913064fa@eisentraut.org> References: <1142ad86-e475-41b3-aeee-c6ad913064fa@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Sat, 11 Apr 2026 12:37:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <419715.1775916598.1@sss.pgh.pa.us> Date: Sat, 11 Apr 2026 10:09:58 -0400 Message-ID: <419716.1775916598@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > The first one is from commit 65707ed9afc (Add backtrace support for > Windows). This would be an error in gcc (from C99 on); it's kind of > incredible that MSVC doesn't even warn about this by default. I propose > to add this warning category to the default set. > (Second thought: For consistency, make this an error, with '/we4013' > instead of '/w24013'.) +1 for making it an error. > The second one is from commit 13b935cd521 (Change dynahash.c and > hsearch.h to use int64 instead of long). I don't have a patch here to > include this in the default warning set, mainly because it doesn't > appear to map to any gcc warning option, but maybe we should add it > anyway, since it can catch this kind of 4-byte-long-on-Windows issue. I think it'd be a good idea to warn even if we can't make gcc do that. I think Windows is the only 64-bit platform we deal with where long is just 32 bits, so covering the case in MSVC will expose bugs we would not notice otherwise. regards, tom lane