]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Disable some C++ warnings in MSVC
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 31 Mar 2026 06:38:24 +0000 (08:38 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 31 Mar 2026 06:42:26 +0000 (08:42 +0200)
Flexible array members, as used in many PostgreSQL header files, are
not a C++ feature.  MSVC warns about these.  Disable the
warning.  (GCC and Clang accept them, but they would warn in -pedantic
mode.)

Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg%40mail.gmail.com

meson.build

index cfd9cc2890de7ef409441eca084a8272408026c2..c4b4cd4af066ec4af2d9dbef02f0fc66c6773973 100644 (file)
@@ -2325,6 +2325,9 @@ if cc.get_id() == 'msvc'
   ]
 
   msvc_cxx_warning_flags = [
+    # Warnings to disable:
+    # from /W2:
+    '/wd4200', # nonstandard extension used: zero-sized array in struct/union [widely used in PostgreSQL C headers]
   ]
 
   cflags_warn += msvc_common_warning_flags