GNU bug report logs - #74427
tests/printf/printf-indexed failure on macOS

Previous Next

Package: coreutils;

Reported by: Grisha Levit <grishalevit <at> gmail.com>

Date: Tue, 19 Nov 2024 04:39:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 74427 <at> debbugs.gnu.org, grishalevit <at> gmail.com
Subject: bug#74427: tests/printf/printf-indexed failure on macOS
Date: Tue, 19 Nov 2024 13:48:03 -0800
On 2024-11-19 12:28, Pádraig Brady wrote:
> But one could consider an empty argument as completely converted?

No, because POSIX says the argument must be a C integer constant, and 
empty strings are not C integer constants. Similar reasoning applies for 
floating point specs like %g, where POSIX says the argument is converted 
as if by strtod, and for an empty string POSIX says no conversion is 
performed by strtod.


> For example scripts with `printf '%d\n' "$int"` will start erroring if int is not defined

It shouldn't be that big a deal, as the change doesn't affect stdout. 
The only issues are stderr and exit status, and that sort of script 
typically ignores both.





This bug report was last modified 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.