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 1ohdQw-0006aJ-Lc for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2022 21:02:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohdQu-0008Ka-47 for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2022 21:02:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohdQt-0008KR-Q0 for pgsql-hackers@lists.postgresql.org; Sun, 09 Oct 2022 21:01:59 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ohdQn-0005hO-AK for pgsql-hackers@lists.postgresql.org; Sun, 09 Oct 2022 21:01:58 +0000 Received: by mail-pf1-x42d.google.com with SMTP id v186so9216404pfv.11 for ; Sun, 09 Oct 2022 14:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jaMVN9raJF5QbLreSZ/5Hlozp3IaqJ1hJK4J2Xs/rJg=; b=Ks+mG4bb/hCTNlK8prq6dAYIZvyTaTB2Uuha7JaSwBScbIOQK+dfi2dIbxggU532Wh p93JSZDqxFrnSlbcKEFes5cTXc5EisEFs8Tvst5PQW9geK/GIK/tU/TKnkJzNMgGWZ1D 62u0zuoDmGcaGElFNsamTyEj+VCihi0QkElDVbds9mRT2Jn2C44OfRPC2UzNTnB6QHm5 OlpuJmoqrtc0aVPM5dytc4gb0hq+haUPraEcuAUiz6TQkbyvQ5V2j5aLdkSOcL1H48+M k9qype4b1QM4xfI5F/mxAJu1RbNDX1imTabZxQNAzHJSpuGARPElMczRSGMsQQaxXHWG yAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jaMVN9raJF5QbLreSZ/5Hlozp3IaqJ1hJK4J2Xs/rJg=; b=cT7/CrWPMttBQs2UQWecAIOC33GnYOL2hZDN6ELI5XmKgY7vSHUIiVP+90F7fV5rvx YYhuaZ277QdQ6ZWZesj2GBp4/4tM2Hm+RwSaZc6smRAJ6SyY+kztGriN3SKYMvcQ0/+f muwfkCq8Y+X7OsHndZoUQVc6tKrZyOgYUFh3USt4yoESGnlf8S6rV89jfzQkMI+sAOhL fPTe9ZGHGb3LztCNFJSlfygHif8qW+Yjo2uvOUJCDlDxk8qRlmT5oLeBnf2FljwJ1OXo AVgEwd8DJDWdbmE0Ro0vnkyZfSLrMyfrBB/u5j+vkuQfngXe1KkUn/8+jU+BfC8vKZzz jHRw== X-Gm-Message-State: ACrzQf34kyGYr1IweM4v3jCp3Q140T7OjGw2cyHF66om0PvXv9pG8NKc 4kPzJa+cGxvIpUFAa+J9m7FZ9vvG9E8= X-Google-Smtp-Source: AMsMyM61oGrXTDCVy7ZErKyrJYHIHMSosjGKyEfRDl/saF4WfYU/z7oKCYhKGsEUPKy2wC4eMm0Enw== X-Received: by 2002:a63:290:0:b0:43c:20be:9f48 with SMTP id 138-20020a630290000000b0043c20be9f48mr13416290pgc.388.1665349311744; Sun, 09 Oct 2022 14:01:51 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id 69-20020a630048000000b0042988a04bfdsm4949028pga.9.2022.10.09.14.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 14:01:50 -0700 (PDT) Date: Sun, 9 Oct 2022 14:01:48 -0700 From: Nathan Bossart To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Simplifying our Trap/Assert infrastructure Message-ID: <20221009210148.GA900071@nathanxps13> References: <3928703.1665345117@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3928703.1665345117@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Oct 09, 2022 at 03:51:57PM -0400, Tom Lane wrote: > I happened to notice that the Trap and TrapMacro macros defined in c.h > have a grand total of one usage apiece across our entire code base. > It seems a little pointless and confusing to have them at all, since > they're essentially Assert/AssertMacro but with the inverse condition > polarity. I'm also annoyed that they are documented while the macros > we actually use are not. +1, I noticed this recently, too. > Hence, I propose the attached. The patch LGTM. It might be worth removing usages of AssertArg and AssertState, too, but that can always be done separately. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com