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.94.2) (envelope-from ) id 1ti845-00Bjw6-Uo for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 08:25:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ti843-0077FG-V1 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 08:25:48 +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.94.2) (envelope-from ) id 1ti843-0077F8-Lc for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 08:25:48 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ti842-000PQh-0f for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 08:25:48 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21f710c17baso70288675ad.1 for ; Wed, 12 Feb 2025 00:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739348744; x=1739953544; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=MfgrxJz2puppq6aPC3PzrtDbCUP7hQJlYXtPgxR0tTA=; b=CSA2QRuHb2NqWgqF7FYqgWryHloHONff3x2Pn8eR4BJ4jvYp3LvkvW2Knp9cLJ5VvQ D06ozPeA6aNoVjrj6ot/uPeVLporiYWNIdtvbgIV9+sK2y5oaPU2UiK810CMMUU247iJ cgklVUaCPtR7mGGNCgKhBAE62j/H4xwnFnkgHe9NlYCow2JWn0sDPRpSyzfajlGpL0as l5TyNQ9Bgp20aBbxpjauH7H/3Yy9tX3VQE2rqtTqOMqFJk6reGjyBZE5ibIbJkZoTblI OmDM+5dKb4XBgYtgRrLLbGh3LgcjCGmStVgsq1+cCFUBugOTmPpFVJATsfqBEtALkQVz BYZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739348744; x=1739953544; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MfgrxJz2puppq6aPC3PzrtDbCUP7hQJlYXtPgxR0tTA=; b=s2tUt2IAzyYemtNO3pa19wLyqSn88mQ5XmBzAe++IJubUJ5OAKE4N62/Gxq/lTb4uP Tm+s7R5+pITP9lbbfjPBUWBAE8mbfwFA81hH9Kw8tJNU+nc97dT9SiLAZPM1wTH3N7+7 QHtg1G2D20r8itKBeITxWvd6PSm+Vly59Ko76YXTEnVVO8EH67gADZ1IsJ5VfJiUy5kL vJyFRvr/ZJ1S6tDIYJ0wUTBzE3Ve/obw93zdGsk3kXIKMDnP3v4CeBxk1W4WRYfDhrhw VI9rSxT77v74P3ARhfQTUdFHnZWpsZq2AxfGkYG+9/zedC73NvgcbynunnI6kuoFoILv JzJg== X-Gm-Message-State: AOJu0YzCOjZ3aiROWuQfmXaHqgEPhWW4WveGZm2i9x9Sd1MdpBJO2i5V HqmXnAwkw2hpy6BYYyGr/MSMdQ9FX/phMcok/vJLEw18IBAtHkrPdPDpkw== X-Gm-Gg: ASbGncuR8+gmy8zvXV2q6nt4+wxqFpYmb0km1poN4pTgdPK03dddKwXdQ6N8eEe52Fb fgKxRq6nS9yq2S/5TDLjwFI9JUkujpR7llOXSakmihEeiuhA7aDt2lZC12a/+qiHdKhlqQU2yP/ uRAtlMEqCDNjXP1u/bYh+NjCKDTJZT7du+qPP0WTZCBSBhEDB3QpA9FEfiTWnj4QD+Y9d2T4mod rr+wf7B8iz8gxKPsqYtNZJuWoLrDNk7VtGWhx88XcF8eopKutYXTU0ycd6OXN0wyr+C4BHlUo/2 8ym+7To= X-Google-Smtp-Source: AGHT+IG45N3ZZR7M3OQesFQIh/bOI2xt7AOAqgqmKKw7DDNgzT6vMzsMNQQYMifzBnJuY1JGuv8HKg== X-Received: by 2002:a17:902:e545:b0:21f:3abc:b9fc with SMTP id d9443c01a7336-220bbab34femr31666545ad.6.1739348744015; Wed, 12 Feb 2025 00:25:44 -0800 (PST) Received: from jrouhaud ([115.43.41.38]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21f368ab20esm107912395ad.224.2025.02.12.00.25.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 00:25:42 -0800 (PST) Date: Wed, 12 Feb 2025 16:25:38 +0800 From: Julien Rouhaud To: pgsql-hackers@lists.postgresql.org Subject: Unneeded volatile qualifier in fmgr.c Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="k0YZuktU0iOd7YhU" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --k0YZuktU0iOd7YhU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, While reading some code in fmgr.c I noticed that the save_nestlevel variable is declared as volatile. I'm assuming that's because a long time ago it was modified in the PG_TRY / PG_CATCH block but it doesn't look needed anymore. Trivial patch attached. --k0YZuktU0iOd7YhU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fmgr_volatile.diff" diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index aa89ae8fe1a..ef0fde51b38 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -639,7 +639,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS) ListCell *lc1, *lc2, *lc3; - volatile int save_nestlevel; + int save_nestlevel; PgStat_FunctionCallUsage fcusage; if (!fcinfo->flinfo->fn_extra) --k0YZuktU0iOd7YhU--