From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 2779 invoked from network); 22 Nov 2023 23:14:18 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 22 Nov 2023 23:14:18 -0000 Received: from mail-oo1-f53.google.com ([209.85.161.53]) by 9front; Wed Nov 22 18:11:47 -0500 2023 Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-586a516755aso635013eaf.0 for <9front@9front.org>; Wed, 22 Nov 2023 15:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700694705; x=1701299505; darn=9front.org; h=content-transfer-encoding:content-language:to:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=0PZ8Dv0bS0mGtOv7vZIBI3EY+PxWyFEx3uBIynZqjLI=; b=F7MgwGVWOLoGHBgRwuDKXGG5tKAySiX6kv3zK8oa6H3k74mI/omPsvHUMkLsCb/ta6 CxiHnHWN2wy0b50CscFSF7vRCfLfDmRBF9hIqohnD5xPrCqwDXsMeae2j4+6axUUrVY+ YUc7pB5aISw3WfBA6nIKRXVu9evGka33XUhCMGDTnl4PavADviHjgZJLxyCE060jlag/ YQEGyY+oWusjCApPNFpjM62hFvv4haXre48VI5I+4YIRi6zmZamIh7MxJOzf4jNoZcbI qPtgNo5IMW66EQncLC4SyYW6q5iDDhNmdzhDTIu/D96aIG35xNpzmTHJeS5y/19jF/fa W2yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700694705; x=1701299505; h=content-transfer-encoding:content-language:to:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0PZ8Dv0bS0mGtOv7vZIBI3EY+PxWyFEx3uBIynZqjLI=; b=NJiN+xrItA8hC/8X+8GaeUiZS+V12f+o6aFTbO45MILvyS/njZUqIBB/9kGr2DeoF3 oCHGQNpOhQpbav/ja28QVPU/2W0IkXmaNUGKRhJFMGvCYkhbZe1vNJw7juoPZd0dC0Rk AYnNpNEquHuqYmWfQrA8mDZfkue3N/JJXxhrL/GXvk8R9HTWQezTc/jr8JfLX8s7H62R kuQPcHaNWJVIaHQd7vq2LAnlewj0SEGoPWdB+gH9/M7hiNzWAX7HPEspheS6ZFYIQ6BP 2pidSn2JdAQWVzkCYP18z9HGbr/4sI6X8+svnE4udexAo+JKFOC08rwH2/E3ZgbAw1vA +knw== X-Gm-Message-State: AOJu0Yw8gAz4gZjZUlaKl30s33aAeLWyxOMU8MFL6hP5npMXm29K9DqQ pBVs2LqtY0onxbZMjjoe45TEcJR6igilEg== X-Google-Smtp-Source: AGHT+IEFrWmVCgieqTWabfqht46fYyZ8jelPR8KN8HBR8Ex7X4WvZ7xNQATYyeb9hGDUxJTp2tVFmQ== X-Received: by 2002:a05:6871:8794:b0:1f5:e3d2:c29e with SMTP id td20-20020a056871879400b001f5e3d2c29emr529860oab.28.1700694705514; Wed, 22 Nov 2023 15:11:45 -0800 (PST) Return-Path: Received: from ?IPV6:2600:1700:e4c0:9ea0::5f6? ([2600:1700:e4c0:9ea0::5f6]) by smtp.gmail.com with ESMTPSA id lu8-20020a056871430800b001d4d8efa7f9sm28965oab.4.2023.11.22.15.11.45 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 15:11:45 -0800 (PST) From: Blue-Maned_Hawk X-Google-Original-From: Blue-Maned_Hawk Message-ID: <904397cf-6c3f-46c4-9139-7f80823ec064@invalid.invalid> Date: Wed, 22 Nov 2023 18:11:44 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: 9front@9front.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: CSS browser lifecycle wrapper Subject: [9front] [PATCH] Fix assert macro to not break on commas Reply-To: 9front@9front.org Precedence: bulk This is a pair of patches that changes the assert macro to be variadic, allowing expressions with commas in them to be used without needing a spare pair of parentheses, and updates the manpage accordingly.  diff 04d6a2acecfe4fe44947da8b676f63bcd0f3c0fe uncommitted --- a/sys/include/libc.h +++ b/sys/include/libc.h @@ -3,7 +3,7 @@ #define nelem(x) (sizeof(x)/sizeof((x)[0])) #define offsetof(s, m) (ulong)(&(((s*)0)->m)) -#define assert(x) if(x){}else _assert("x") +#define assert(...) if(__VA_ARGS__){}else _assert("__VA_ARGS__") /* * mem routines  diff 04d6a2acecfe4fe44947da8b676f63bcd0f3c0fe uncommitted --- a/sys/man/2/assert +++ b/sys/man/2/assert @@ -7,7 +7,7 @@ .B #include .PP .B -#define assert(cond) if(cond);else _assert("cond") +#define assert(...) if(__VA_ARGS__){}else _assert("__VA_ARGS__") .PP .B void _assert(char* cond)