From: Jeff King Date: Mon, 08 Jun 2009 22:04:24 GMT Subject: Re: [PATCH v2 1/3] Introduce die_errno() that appends strerror(errno) to die() Message-ID: <20090608220423.GA29942@sigill.intra.peff.net> In-Reply-To: <2325a7950906080835h6d6d2d28j2c7261f2296a3da6@mail.gmail.com> On Mon, Jun 08, 2009 at 07:35:55PM +0400, Alexander Potashev wrote: > > More than that, you must support arbitrary printf format strings, > > because the die routine is passed whatever goes to die() (a quick grep > > revealed that we use at least %u and %c at various points). So it is an > > undocumented requirement that the die routine process its parameters as > > if it were from the printf family. > > Your last statement is not quite true. A custom die routine may > support all printf specifiers and some additional ones, but Thomas' > die_errno passes the format string (and arguments list) to vsnprintf > anyway, so the additional specifiers would be lost. But if die() is called (_not_ die_errno), then the format is passed unchanged. So what I am saying is that anyone supplying a die_routine _already_ has to handle all printf format specifiers. So asking them to handle just "%s" via die_errno is not introducing any additional requirements. -Peff