Subject: Re: bin/21970 (printf(1) breaks when format begins with "-")
To: None <hubertf@NetBSD.org, gnats-admin@netbsd.org,>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 11/27/2006 21:50:03
The following reply was made to PR bin/21970; it has been noted by GNATS.
From: David Laight <david@l8s.co.uk>
To:
Cc: gnats-bugs@NetBSD.org
Subject: Re: bin/21970 (printf(1) breaks when format begins with "-")
Date: Mon, 27 Nov 2006 21:45:58 +0000
On Mon, Nov 27, 2006 at 09:21:24AM +0400, Alan Barrett wrote:
>
> I still think it's a bug that printf(1) uses getopt. I think it's wrong for
> any utility that doesn't take options in the usual way to use getopt().
From:
http://www.opengroup.org/onlinepubs/009695399/xrat/xbd_chap12.html
Applications calling any utility with a first operand starting with '-'
should usually specify --, as indicated by Guideline 10, to mark the end of
the options. This is true even if the SYNOPSIS in the Shell and Utilities
volume of IEEE Std 1003.1-2001 does not specify any options; implementations
may provide options as extensions to the Shell and Utilities volume of IEEE
Std 1003.1-2001. The standard utilities that do not support Guideline 10
indicate that fact in the OPTIONS section of the utility description.
David
--
David Laight: david@l8s.co.uk