Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcKR0-0005eJ-5b for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 03:35:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcKQy-00028p-Gu for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 03:35:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcKQw-00028h-Vv for pgsql-hackers@lists.postgresql.org; Tue, 10 Nov 2020 03:35:04 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcKQm-0000dW-1C for pgsql-hackers@postgresql.org; Tue, 10 Nov 2020 03:35:02 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F27BE5C01D8; Mon, 9 Nov 2020 22:34:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 09 Nov 2020 22:34:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=HFvQrXEk2FHMu+y1sM7h797O1Tk VRD//arz+QakOczc=; b=P5PgAkoH9kEW6b5IAaDuo04Q9sKsjlDiJwEuPvkNTq9 LpY62O+gjBeAnWp6p2wSNQoClSq0IdKCcazcHlWeTJAPixEdzdsS0hSmEtF0v9ff t8YaWL5kqkHNZVUXlynuG9ffuusTHpcGtlVkWwAzSKIQ0jrO+g7JKqxUNymZwaKL dk0XCEJp0Kw8PQD9y6yOE8JtSA6HLg1m5WD47lcV0g0qEwNvGCrMa8Xt3SdAmSLY jwrYKOeN4F9sTrvTAivES2PDhy2kPZWvv/qVRZevc3bpVhKh39Er2EchsKO9f01e nnBaJXR/LcYRG1ldh8T+cizevjpGIRUFItr5vpD4Hgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HFvQrX Ek2FHMu+y1sM7h797O1TkVRD//arz+QakOczc=; b=ALtaSeq9ICn+fm/WnSFV9p Xn4BWRtdV15E1r48HTXuo5RgUj9V2w6WQ0+DM4Hff+UrLTKW2UqYIZ+Tfc0EWTa3 TpbLahpbNzNAXm7folnMwCqlv/NuvzgLYwSoi6LUvNqhF4X17McwGrWGt9ogOcq1 XqClv3Vt2VPyynCXYkIeVBYTouxh+iUgz7WbtpPXPTYhloZEwihPYerv3sJHG1h6 jYGWZ1jfhVLDbh5Z9TcxLH/SXWqSCjlEBBOCBm0ZXhBju4aZ26fRJApfVyalmva6 pRWNRjup2ti3d7Xrjcpc8Y3KpW19/ufSxn+98FYrFZ1KAlNBfSybawVFN24tRYBA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduiedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id BF6A83280063; Mon, 9 Nov 2020 22:34:48 -0500 (EST) Date: Tue, 10 Nov 2020 12:34:45 +0900 From: Michael Paquier To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: warn_unused_results Message-ID: <20201110033445.GH1887@paquier.xyz> References: <20201109065606.GA11424@paquier.xyz> <8ef6a7dc-5ea1-46b3-4406-7be7d07886f0@2ndquadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PWfwoUCx3AFJRUBq" Content-Disposition: inline In-Reply-To: <8ef6a7dc-5ea1-46b3-4406-7be7d07886f0@2ndquadrant.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PWfwoUCx3AFJRUBq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 09, 2020 at 08:23:31AM +0100, Peter Eisentraut wrote: > On 2020-11-09 07:56, Michael Paquier wrote: >> This is accepted by clang, and MSVC has visibly an equivalent for >> that, as of VS 2012: >> #elif defined(_MSC_VER) && (_MSC_VER >=3D 1700) >> #define pg_nodiscard _Check_return_ >> We don't care about the 1700 condition as we support only >=3D 1800 on >> HEAD, and in this case the addition of pg_nodiscard would be required >> on the definition and the declaration. Should it be added? It is >> much more invasive than the gcc/clang equivalent though.. >=20 > AFAICT from the documentation, this only applies for special "analyze" ru= ns, > not as a normal compiler warning. Do we have any support for analyze runs > with MSVC? You can run them by passing down /p:RunCodeAnalysis=3Dtrue to MSBFLAGS when calling the build script. There are more options like /p:CodeAnalysisRuleSet to define a set of rules. By default the output is rather noisy though now that I look at it. And having to add the flag to the definition and the declaration is annoying, so what you are doing would be enough without MSVC. >> I am not sure >> about the addition of repalloc(), as it is quite obvious that one has >> to use its result. Lists are fine, these are proper to PG internals >> and beginners tend to be easily confused in the way to use them. >=20 > realloc() is listed in the GCC documentation as the reason this option > exists, and glibc tags its realloc() with this attribute, so doing the sa= me > for repalloc() seems sensible. Good point. -- Michael --PWfwoUCx3AFJRUBq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl+qClUACgkQnvQgOdby QH1jPRAAoHyH+RYKEb8PiK7ycwXWxN7TkcUtR9/xKnyO4jkNE+TosK/schsV7oHx bL1wdZfauuhIPOunZn7pwmU8JXgCsJfMoyk7quPhNxLicGD8t201xOeZN8Qmxm76 uXzaBzdti6xsbL5eeFId/kjDArPpMiYJbeaY+Llp8/UXl66QWxA6LjuTVtsPtnE8 +MNVpfqb4dikP0MeNQq3IlOK9iMagMDkrfakzHpFlYsMff5E2kKm2ZEeinGyRrtf YEEL/d05gUAt5ucZt7o9ap1nEUcW9beSvwTWhtfWMcu+Ur770cJ54dNralAvYJv7 FhEmXAVlG4dgyVA/qruOyNuIcZtXNwydrz03J3EWhTbfQ3AM0NtbQ2vPglNQAIAd kQKUaSa21lx6BYJC0/NrQq6OLEGPZko5r1gHCQ3/YdJG+Y5cTgJOYkjUlzOUnONM Xr5ppOEs1zqYobRez2Xkvu5+Cey2tQboljfIYI8/uCPp0mgQoneRiHK4KuglmdaV 5bksT7njRknHm7oF9cEi6l5LxJMAECBYLE3El3x/+bVpWepgYapwiSLuCckdFGXv rnkZ/QiaFCG4Se4FuGi+8zARtJl4gBxaBzybTsT3hsPY+k+F1cok5FG1xgyQg6WB dDg+G1lTjT8eISnQOaHII0f5WGLGff3vVs42Pkel9e0sXnXMxe8= =XJd3 -----END PGP SIGNATURE----- --PWfwoUCx3AFJRUBq--