Bruno Haible wrote, on 16 Jan 2022:
> 
> Eric Blake wrote:
> > 
> > The question on the floor is whether GNU msgfmt would consider
> > tweaking behavior so that -v implies -c (that is, turning on verbosity
> > now also turns on format checking), so that there is one less option
> > letter to standardize, and so that users can just rely on 'msgfmt -v'
> > for message checking regardless of GNU or Solaris implementation.
> > 
> > Or put another way, the Austin Group would like to standardize only:
> > 
> >      -v    Verbose. If this option is specified, msgfmt shall detect and
> >     diagnose input file abnormalities which might represent
> >     translation errors. The msgid and msgstr strings shall be
> >     compared. It shall be considered abnormal if one string starts or
> >     ends with a <newline> while the other does not.  Also, if the flag
> >     c-format appears in a "#," comment for this entry, it shall be
> >     considered abnormal if the strings do not have the same number of
> >     '%' conversion specifiers, or if corresponding conversion
> >     specifiers take different argument types (see [xref to
> >     fprintf()]). If an abnormality is detected, the exit status shall
> >     be non-zero and a diagnostic message shall be output.
> > 
> > which would still leave -c as a GNU extension, but give users the
> > ability to get format checking across both implementations with just
> > -v.
> 
> I object, for three reasons:
> 
[...]
> 
> In summary, the best course of action is to have two orthogonal options
>   '-v', that increases the verbosity,
>   '-c', that diagnoses abnormalities and modifies the exit code accordingly.

Unfortunately this would require significant change to the Solaris msgfmt.

Here's an alternative suggestion:

In POSIX we could specify the behaviour when both -c and -v are used,
but say that if one is used without the other, the behaviour is
unspecified.  (Or something narrower, such as it is unspecified
whether the behaviour is the same as -c -v or is somewhere between
neither and both, if we can come up with suitable formal wording.)

Then the only change needed in Solaris would be to add a -c option
that is the same as -v except it affects the exit status.

GNU users who don't care about portability could carry on using -c and/or
-v as they do now.

Solaris users who don't care about portability could carry on using -v
as they do now, or switch to -c -v if they want to take advantage of
the exit status change.

Users who want portability would have to use both -c and -v (or neither).

-- 
Geoff Clare <g.cl...@opengroup.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

Reply via email to