Glenn Fowler wrote:
> On Tue, 12 Feb 2008 10:07:46 +0100 Casper.Dik at Sun.COM wrote:
> > The standard does NOT require an argument of the form -------- to elicit
> > an error.
> 
> right
> there are conforming implementations
> and conforming applications
> 
> solaris and ast/ksh printf are conforming implementations
> 
> printf ----- is a non-conforming application
> 
> non-conforming means non-portable
> the reality is most people code to eliminate diagnostics
> but that is not sufficient to "guarantee" conformance
> 
> we can workaround the printf problem by issuing a warning
> diagnostic for invalid option (its currently an error with
> non-0 exit status) and treat the option and all subsequent
> operands as operands
[snip]

AFAIK this is not neccesary nor allowed. The "printf" utilty is (AFAIK)
expected to return non-zero exit codes if any invalid/unsupported
options are passed as arguments before "--". Changing this may break the
test suites (see http://defect.opensolaris.org/bz/show_bug.cgi?id=502)
and that would violate the ARC stabilty status of /usr/bin/printf which
says:
-- snip --
ATTRIBUTES
 See attributes(5) for descriptions of the  following  attri-
 butes:

 ________________________________________________________
|       ATTRIBUTE TYPE    |       ATTRIBUTE VALUE       |
|_________________________|_____________________________|
| Availability            | SUNWloc                     |
|_________________________|_____________________________|
| CSI                     | enabled                     |
|_________________________|_____________________________|
| Interface Stability     | Standard                    |
|_________________________|_____________________________|
-- snip --

IMO it's better to rely on the standard in this case and not on what
people think how the standard may look like... we already have enougth
utilities in /usr/bin/ which behave like that (that's why Solaris has
/usr/xpg4/bin/ and /usr/xpg6/bin/ ... ;-( )... ;-(

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to