![]() |
|
Message-ID: <20240310234410.GW4163@brightrain.aerifal.cx> Date: Sun, 10 Mar 2024 19:44:10 -0400 From: Rich Felker <dalias@...c.org> To: Thorsten Glaser <tg@...bsd.de> Cc: musl@...ts.openwall.com, NRK <nrk@...root.org>, Alejandro Colomar <alx@...nel.org>, Guillem Jover <guillem@...rons.org>, libc-alpha@...rceware.org, libbsd@...ts.freedesktop.org, "Serge E. Hallyn" <serge@...lyn.com>, "Skyler Ferrante (RIT Student)" <sjf5462@....edu>, Iker Pedrosa <ipedrosa@...hat.com>, Christian Brauner <christian@...uner.io> Subject: Re: Re: Tweaking the program name for <err.h> functions 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.