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 7622 invoked from network); 29 Nov 2023 09:15:36 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2023 09:15:36 -0000 Received: from mail-ot1-f41.google.com ([209.85.210.41]) by 9front; Wed Nov 29 04:14:05 -0500 2023 Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6d81fc0ad6eso2250960a34.2 for <9front@9front.org>; Wed, 29 Nov 2023 01:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701249242; x=1701854042; darn=9front.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:user-agent:mime-version:date:message-id:from:from:to:cc :subject:date:message-id:reply-to; bh=zu1gpUNP9bkIXQpq+xhRG91yFqxls/Mz4l4knfgVsUo=; b=SvhekFb81Mty83bKWp53YPyjM8qIAS2AAvf5g0wkddwx5nvL71WoZAx7Khyoz2LXHg 69ieRW74CKvr3JU3uHzPK9nM3QWNztyn0PhU4tmU293jnsG6bGdBCG6RT4z0+9K7cJLY 2e9YBoCPfBslMgMiZEEYVd6AgL4pFmNkhOZ6alF0MZ4fbzF/am7yIkaZp8k8iPCqyZNl p2+uHqMS3WznE54q9UvkPZu4ONfTm4sXtTM1VxtrY+4+XSg94CYkkbcPWpEyf9aRwKkO lQTZCekSl4XH5waz5Y7J4dWUqHw/EWSpn07FQ+xy1hvKWipzTQU7luflnC81Ew6mp6OB g+1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701249242; x=1701854042; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zu1gpUNP9bkIXQpq+xhRG91yFqxls/Mz4l4knfgVsUo=; b=NxGpbSurqZ6+/5iHLBMSR3Om3GknA+fP9PEyHNffDcmkneVu8DBVk8qpzNIdX8w/SL V0qPRdvlvYKV5Ean/jNvXAbDObdYp4h3OWabWo0+rHFywYbGFWbsIiyQm7OI0rkrqqlg 0M1903UYjqgkXmAvTMvdTGzH/svSIO1L9Ie4zBI15acvJLJGsaY3sLMxJ6xxjcxDT3wd 1Kwv8YwIXkxyxcv6jpth0UgqvQ6H3espe2p82rzQHEVLK2GgbIpF740OMWagChRmRh4v e2B+uPR4ypRqbkJpblsRSZ4Qd4GagNEzUbr91EenBaK/pB9HiEulppnm4RB8PLsipb8Y m2Hw== X-Gm-Message-State: AOJu0YyRqUpU9zvJ2MtLpLJGbfT0IJmtVTjNw694Hfu95wU0KzsRPmiK llTmM46Q375yOnxDN+H2stX8c8jYLu59qw== X-Google-Smtp-Source: AGHT+IHi0YIyjOQuaOHrjS7LKv/YSio15zmYjXfrXYc/VI6tJ/irZwO7Qay4o1hKchE3gNWg4GIQZQ== X-Received: by 2002:a9d:784c:0:b0:6b7:4a52:a33a with SMTP id c12-20020a9d784c000000b006b74a52a33amr18472450otm.14.1701249242408; Wed, 29 Nov 2023 01:14:02 -0800 (PST) Return-Path: Received: from ?IPV6:2600:1700:e4c0:9ea0::49? ([2600:1700:e4c0:9ea0::49]) by smtp.gmail.com with ESMTPSA id h14-20020a056830164e00b006ce2e1a6cb2sm1940259otr.44.2023.11.29.01.14.01 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 01:14:02 -0800 (PST) From: Blue-Maned_Hawk X-Google-Original-From: Blue-Maned_Hawk Message-ID: <1f4ff6f9-bc65-430a-8c34-bfa2f7b23ece@invalid.invalid> Date: Wed, 29 Nov 2023 04:14:01 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: 9front@9front.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: self-healing package cache realtime generator Subject: Re: [9front] [PATCH] Fix assert macro to not break on commas Reply-To: 9front@9front.org Precedence: bulk On 11/27/23 19:34, ori@eigenstate.org wrote: > Quoth Blue-Maned_Hawk : >> I don't understand what you're referring to or what you are saying. > > msg doesn't have to be a string literal, it can be an expression > containing commas. > After some fiddling, i have come up with this solution: #define _0assert_msg(...) (print(__VA_ARGS__), exits(__VA_ARGS__))) #define assert_msg(...) ((__VA_ARGS__) ? (void)0 : _0assert_msg which can be invoked as assert_msg(cond)(msg); without any worry about misinterpreted commas.