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 1tKjFO-00ARl9-8J for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2024 19:16:46 +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 1tKjFL-00Ax4Z-HH for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2024 19:16:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKjFL-00Ax4M-5Z for pgsql-hackers@lists.postgresql.org; Mon, 09 Dec 2024 19:16:44 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKjFJ-001wxv-Rw for pgsql-hackers@postgresql.org; Mon, 09 Dec 2024 19:16:43 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3a7e108b491so38057915ab.3 for ; Mon, 09 Dec 2024 11:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733771801; x=1734376601; darn=postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Fqb6gwv0mE5ePbBD1j5Zeu0I/YB4R4pYsjKXR8qIqzg=; b=UiVtIbCtr4oYtnRfUApP4H522xv2/y1e2BQmEuKzbReuN852d7a+uPINAnv50GKd58 /GS4Cvv+8aG4klTGobxHdfuGFfKa4zhhk3Nr44maN1XJAsNmA5onXF+Pi7wTvKx87IPT Ns7T4b+tXzAJIHqyKsc+w0fK7khrsckqfTKIcmQkCcGyEV8KSy/EKWxnLYLpQ9iYM7H8 0Y9+DPdKNLHRseFsXxhEWsTJOEDkyx2S6AQRmaOg6Xy873rnb9D0Fv0Mjp1zZS1BjjvS rPbJnNXUJpmJWB+zCHxuNn19Hk21nZxbueuH/2muSS8KusoEzUSEz2CQs3xGd6wpx8Ad 8FrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733771801; x=1734376601; 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=Fqb6gwv0mE5ePbBD1j5Zeu0I/YB4R4pYsjKXR8qIqzg=; b=Y3QkpiGhJA6dgFHSZJC5RfC1j+47DbpDQaBZFhqEYf42FOj9hBYfPQRqxmOtiCrSYu qFZDijY7bTukCdQjReUHkEkRLklwELEnDcSVEJJyZLGPOS61GDdrlfLzyDmAdhIyv2sT iP91+Jqi4JZbWRWE0se/tWta4r0fo+Gx2TjW/IDl5N+4w4i68sjrJ6wG4cmsmtNFgrXP JydOl/rRILqzvN+OBXRwxyRBAYrvwLnzeFOP5dSb3LUt+diUnUN09ratBBkWZ0Kx4zpP +f/r62d7GrnIesGLXk6blmNR/Phllk4kYi3im9uYBJIMEr+gmmm+X8Cf5B4O8/tqS4wJ iGyQ== X-Gm-Message-State: AOJu0YyDFToHD0sP7vDdLFhtP7upwnflb0+mF5VMhOjBtLpjRpe5moqv C78UFIYh45k885wXs8/M+tkamSK92GfSPuuorNyuTfdWzkWqhw8bPQ18yw== X-Gm-Gg: ASbGncsAuYYvmctEUvqAxGIF+/HEXsNnrnRwJodzRsEoNDpMpOEoHRmYp3NBiN6sPdK XJ0qqrPqVyTCk/vV6WnQiXl+EcI6NpZ+jU4IdRGJKke0ouvIIHS1ZrHKDzARWd4W5bvcemzPM5k MzUhV6vhsgO21Y4OeEEj2+HTWS0lrE3a7a+S+Ir80HpwruEJDF64jA729ZxT3Ei+XRck8Jz1w9D SPPOxxvmn8hoiX608+KTGQcQQDVTGNn/V/DaOdoiufG2be56gwTaeBs9idI+Eadp7mh0NBKgFZf 40rHcL9PRAHqiEjn1UorJPWw6zpIA9xqsrcLesce X-Google-Smtp-Source: AGHT+IGPR/Rsb9iRiiFa8ZF+SJFshS4gd1oKZPBWhUT0hJ3vPhIdnXXyllk/QX1IuDgbPGnrYqZPfQ== X-Received: by 2002:a92:c545:0:b0:3a7:c072:c69a with SMTP id e9e14a558f8ab-3a9dbaba364mr21649245ab.3.1733771800900; Mon, 09 Dec 2024 11:16:40 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e2ab09435dsm1266831173.66.2024.12.09.11.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:16:40 -0800 (PST) Date: Mon, 9 Dec 2024 13:16:38 -0600 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: unused-but-set-variable warning on REL_13_STABLE Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="61Tx71ZR3GiDtGMQ" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --61Tx71ZR3GiDtGMQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline My compiler emits the following warning on REL_13_STABLE when assertions are disabled: reorderbuffer.c:2471:8: warning: variable 'spilled' set but not used [-Wunused-but-set-variable] 2471 | Size spilled = 0; | ^ Adding PG_USED_FOR_ASSERTS_ONLY (as in the attached patch) seems sufficient to suppress this warning. On newer versions, this variable is used for more than assertions, so the patch only needs to be applied to v13. Since this is trivial, I plan to commit it shortly. -- nathan --61Tx71ZR3GiDtGMQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix_unused_warning.patch" diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index c7f8fa6216..56c25e3a6d 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -2468,7 +2468,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) dlist_mutable_iter change_i; int fd = -1; XLogSegNo curOpenSegNo = 0; - Size spilled = 0; + Size spilled PG_USED_FOR_ASSERTS_ONLY = 0; elog(DEBUG2, "spill %u changes in XID %u to disk", (uint32) txn->nentries_mem, txn->xid); --61Tx71ZR3GiDtGMQ--