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

that way the standard output will be the same
and/but the non-conforming application will be nudged
with a warning diagnostic which could say something like
"use -- before the first operand that starts with -"

-- Glenn Fowler -- AT&T Research, Florham Park NJ --


Reply via email to