[ksh93-integration-discuss] Compatibility and /sbin/sh

Glenn Fowler gsf at research.att.com
Tue Feb 12 05:32:02 PST 2008


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 --



More information about the ksh93-integration-discuss mailing list