Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3JZ0-0007hs-Ta for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 11:57:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3JYz-0004V9-Io for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2019 11:57:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3JYz-0004V0-3q for pgsql-hackers@lists.postgresql.org; Mon, 11 Mar 2019 11:57:49 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3JYv-0006Nx-36 for pgsql-hackers@postgresql.org; Mon, 11 Mar 2019 11:57:47 +0000 Received: by mail-qk1-x744.google.com with SMTP id o129so548218qke.8 for ; Mon, 11 Mar 2019 04:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6q6QYKGK68EXICOw4FdzZdx3+KIyCt6daMkDz/o+TTU=; b=izLSpgl+Td2lxEw+BrKO6mbn08Y9hPe76qv1o38H/CXjY3SLFUtbCn/X/xRKY5n4hi xwkvGmAW4/7MkncuuKGAdN7aPSa1kW0h1p3q8CqARH8YlbIWaQXPUA6XBVBqN0nk//wR Ln9jmFzMYbCmID/7Jg4SSQCND22U7XeYikGhawyZr8W1v0ZHwZZP42WiGsdHq8Iwvs6d HwTWBhL3KapJPALf16GoFCFGGDZN4l+GhAzVc6yXVBP5TJT61wjxQKu7H3DPQnGsgP7k YcEJjMsJ0EzzSyLt5Bb5ijHepA6vbj2msgvCVcObRSvUQkdhoDQDN2dR1VxawQ420ZGL SEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6q6QYKGK68EXICOw4FdzZdx3+KIyCt6daMkDz/o+TTU=; b=lo1ozFz8GBC0q5Brn4lcIfh10hAdZoPWsI+Nfb5UDhBUJqinZ+BXaGCK4c8HW8uTBA +FjTz4vz8Sk9959EW+jFY4Ea4poZBrYPuOzVIRjjCrIKUNSEWYfyZcleqO5ICO2mwHSg P/pOWw2YT4+3YLrIr5iQ91l+FSH7iOwEXMWOMIcIoq+QqOMynpbNFNyypD3EK58GG3Qj EeCfApww63Ha9d4daN5jNlDhSB/dRombuMJ+M/dZJZAiHlnBbsDgO/RaJzySBVUvOTqk WP4ot7bjQw625Le//BfJbxnRb2tP/sUMGwH6P65vbr/W+1tjlA6VCrvpDfHl7YNiG2+B 0GTg== X-Gm-Message-State: APjAAAXiST0gv1oWdbzvmS+uo8KJi2vKCpo6vWwti2PzXqPiVQtwbCJD E6IQuTl1SG0hcmppFvyLZxGmHWYoUMWwyg== X-Google-Smtp-Source: APXvYqyaMzkZQZeOeBQKfNus7wrWsrL/ztpGzVHTUkY1uZKIeOMCB9aSf9SwlbB0ZEB87/mOhfxrhA== X-Received: by 2002:a37:8b85:: with SMTP id n127mr7991636qkd.335.1552305464015; Mon, 11 Mar 2019 04:57:44 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id g5sm509589qke.71.2019.03.11.04.57.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 04:57:43 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id CF63A121DD2; Mon, 11 Mar 2019 08:57:39 -0300 (-03) Date: Mon, 11 Mar 2019 08:57:39 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: Fix volatile vs. pointer confusion Message-ID: <20190311115739.GA5231@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Mar-11, Peter Eisentraut wrote: > Variables used after a longjmp() need to be declared volatile. In > case of a pointer, it's the pointer itself that needs to be declared > volatile, not the pointed-to value. So we need > > PyObject *volatile items; > > instead of > > volatile PyObject *items; /* wrong */ Looking at recently committed 2e616dee9e60, we have introduced this: + volatile xmlBufferPtr buf = NULL; + volatile xmlNodePtr cur_copy = NULL; where the pointer-ness nature of the object is inside the typedef. I *suppose* that this is correct as written. There are a few occurrences of this pattern in eg. contrib/xml2. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services