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 1nwSIk-000736-5U for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jun 2022 17:38:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nwSIi-0007vo-9e for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jun 2022 17:38:32 +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 1nwSIh-0007ve-W1 for pgsql-hackers@lists.postgresql.org; Wed, 01 Jun 2022 17:38:32 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nwSId-0006aS-R6 for pgsql-hackers@postgresql.org; Wed, 01 Jun 2022 17:38:30 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-e93bbb54f9so3603114fac.12 for ; Wed, 01 Jun 2022 10:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6rwe4WxxM7qdSrQGqFRkC/ayFoZpTpxA/IGnzsghiPU=; b=gMGJiDNaGlcA40R20VZpZPwa9H5S3WBDfZTbe5/6+ZyGR+794udDpyb1b9hPgZJix2 INGLJsSSAkWvX/ipYC7M1PGrCsQ31Dg4dNdvSXejpkFiz6mIZV9zQrA5KYxx1y/Hs/Ix s7/yK1RHHniw/nIieumSvSBUcazRqut9PlNHE1Fjwjev96eFnY8Qth2yzT2uELJfjw5A 63i1m1fG8AUInu1m9zo2yZOjHYOY05EgNMaTT3IPWtJ8dQUZyqmJTho0yqol3Z1nnmp5 GMQSfT+MARiYzjIEkke/zXEv1VGM1Q3ObrqVCL53oUqDMEwZYSqQn/iFKDF34w2LI384 pirg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6rwe4WxxM7qdSrQGqFRkC/ayFoZpTpxA/IGnzsghiPU=; b=290AwlYuHyp1TI5f9VtE8uyMpLG528IQBdRpOVLHtpM2VkXBDT4KEAyegTsGEjdyrH kFFrYDn2HWfODCtdwUjLP0DqgpFdGgt6t3nhL+jqehl6ot6aMY4KWr8BmK5sPEKRyJUE q4LGvb0XGh2JmZ++8gnPcJG3yYN/TQVxuqdlSfkRlK6S0Y453uSoFyc7tOES+ageVd8N vDtpN9OgbU5BdueeMyEJ+nto61u0R3rlLtLQdBI+kNdKKgV4E4chtlmJR0WWGIqymyoL 5t4Mu9Rhr7ufWlzB4BBfFAub0XcghOpRWRdIJ0gFMyjvBtzzeiPkJ6yTK4g5EafAhkzI Sqhg== X-Gm-Message-State: AOAM531T6hdRcON9pE3MB0lAS5bjEWq2DSmv5vsJPDrML4KvtJ1EarbS XE8WYUYrE/xM3YyuWvF/82w= X-Google-Smtp-Source: ABdhPJyTC1KpcCVE0XgPx/5Gi1QTgYm+T5HhUUxGDsMD0MMIsfRzYNjFVL4HNM/dOeCc85icVjeiMQ== X-Received: by 2002:a05:6870:a792:b0:f3:1eca:5ba6 with SMTP id x18-20020a056870a79200b000f31eca5ba6mr348170oao.212.1654105106229; Wed, 01 Jun 2022 10:38:26 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:e96d:2f53:a7a5:ea35]) by smtp.gmail.com with ESMTPSA id a22-20020a9d7256000000b0060603221261sm1046256otk.49.2022.06.01.10.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 10:38:25 -0700 (PDT) Date: Wed, 1 Jun 2022 10:38:24 -0700 From: Nathan Bossart To: Tom Lane Cc: Zhihong Yu , PostgreSQL-development Subject: Re: silence compiler warning in brin.c Message-ID: <20220601173824.GA2396891@nathanxps13> References: <20220601163537.GA2331988@nathanxps13> <626379.1654103181@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <626379.1654103181@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 01, 2022 at 01:06:21PM -0400, Tom Lane wrote: > Zhihong Yu writes: >> It seems the variable can be initialized to the value of GUCNestLevel since >> later in the func: >> /* Roll back any GUC changes executed by index functions */ >> AtEOXact_GUC(false, save_nestlevel); > > That seems pretty inappropriate. If, thanks to some future thinko, > control were able to reach the AtEOXact_GUC call despite not having > called NewGUCNestLevel, we'd want that to fail. +1 > It looks like > AtEOXact_GUC asserts nestLevel > 0, so that either 0 or -1 would > do as an "invalid" value; I'd lean a bit to using 0. I only chose -1 to follow a117ceb's example in amcheck. I have no preference. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com