From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [IPv6:2001:19f0:5:42::1]) by sourceware.org (Postfix) with ESMTPS id 039303858433 for ; Sun, 10 Mar 2024 23:43:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 039303858433 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=libc.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=libc.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 039303858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:19f0:5:42::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710114234; cv=none; b=hGehvkG0nOpntuXuJYTR3xl91PyJGF4x8FP4S95nDt70H2TBLpodBSnewkiwfKd9X0H2yT1zYXIWhIM9mTbJYfpSUzaqkfgvrsPQ9Pe2VMbdgax+CO6NrrTunaiYK3as0dZqFLdgeHXwtnhcYgItDlXbvw8KPAyfysSe5YbM6iY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710114234; c=relaxed/simple; bh=2J6hAShjw4KEFAy1eNJonCYl7z0SZJGUo08zCeW6JkQ=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=B79aB4fzKf+9E5HiWSupWUiG1epTcOIEPOpeJs2EOkIP6WS4tTEG1Imk0rxJpdDc7Io4L0tAYbTg2zLQbnbek/WgMmVmTgPF1ujGmsVFlgtlDaeJAMDqzr+xaW8tqW/8hYUmcgxR2cw/FPYOGsom0lm4/zyPo6c9W4eIYCA89z0= ARC-Authentication-Results: i=1; server2.sourceware.org Date: Sun, 10 Mar 2024 19:44:10 -0400 From: Rich Felker To: Thorsten Glaser Cc: musl@lists.openwall.com, NRK , Alejandro Colomar , Guillem Jover , libc-alpha@sourceware.org, libbsd@lists.freedesktop.org, "Serge E. Hallyn" , "Skyler Ferrante (RIT Student)" , Iker Pedrosa , Christian Brauner Subject: Re: [musl] Re: Tweaking the program name for functions Message-ID: <20240310234410.GW4163@brightrain.aerifal.cx> References: <20240309150258.GS4163@brightrain.aerifal.cx> <20240310193956.GU4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Mar 10, 2024 at 11:22:51PM +0000, Thorsten Glaser wrote: > Rich Felker dixit: > > >possibly newline suffix, if you want that). They could have been > >designed to be one-line macros, ala... > > Nope. > > No __VA_ARGS__ and especially no ##__VA_ARGS__ in C89, back then. Well yeah, "could have been" was poor wording by me. At the time, the options didn't exist. But someone doing that kind of interface now can use these tools, or just design the interface differently. With that said, while I'll grant that there are exceptions, it's generally my impression that if you're pasting in the name of the program from argv[0] programmatically because it can't just be part of the string literal, because the string literal appears in modular library code that gets called from multiple utilities, then printing an error message (and even worse, exiting, if you do that too), rather than returning meaningful error information up to the caller for it to handle/display, is just really sloppy, low-quality programming. Rich