]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
MSVC: Turn missing function declaration into an error
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 16 Apr 2026 07:53:03 +0000 (09:53 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 16 Apr 2026 07:53:03 +0000 (09:53 +0200)
Calling an undeclared function should be an error as of C99, and GCC
and Clang do that, but MSVC doesn't even warn about it in the default
warning level.  (Commit c86d2ccdb35 fixed an instance of this
problem.)  This turns on this warning and makes it an error by
default, to match other compilers.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/1142ad86-e475-41b3-aeee-c6ad913064fa%40eisentraut.org

meson.build

index be97e986e5d4d39a980df8c2b15b63860156ab96..7f82876dbc82650cc4250058354a01a9dd493cc0 100644 (file)
@@ -2330,6 +2330,9 @@ if cc.get_id() == 'msvc'
     # Additional warnings to enable:
     '/w24062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled [like -Wswitch]
     '/w24102', # unreferenced label [like -Wunused-label]
+
+    # Turn this into an error, to match other compilers (as of C99)
+    '/we4013', # 'function' undefined; assuming extern returning int' [like -Wimplicit-function-declaration]
   ]
 
   msvc_c_warning_flags = [