public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28944] New: strfmon field width is inconsistent with %f formatting
@ 2022-03-04  8:44 fweimer at redhat dot com
  2022-05-23  9:08 ` [Bug libc/28944] " cvs-commit at gcc dot gnu.org
  2023-02-06 17:57 ` carlos at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2022-03-04  8:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28944

            Bug ID: 28944
           Summary: strfmon field width is inconsistent with %f formatting
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

strfmon field width currently counts bytes, not characters, unlike printf (bug
28943). This does not seem useful for localization purposes.

POSIX.1-2017 requires counting bytes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/28944] strfmon field width is inconsistent with %f formatting
  2022-03-04  8:44 [Bug libc/28944] New: strfmon field width is inconsistent with %f formatting fweimer at redhat dot com
@ 2022-05-23  9:08 ` cvs-commit at gcc dot gnu.org
  2023-02-06 17:57 ` carlos at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-23  9:08 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28944

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Florian Weimer <fw@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=21bb8382b62f7dc20b9936bab32658e8fd5952e0

commit 21bb8382b62f7dc20b9936bab32658e8fd5952e0
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon May 23 10:08:18 2022 +0200

    stdio-common: Add tst-vfprintf-width-i18n to cover numeric field width

    Related to bug 28943 and bug 28944.

    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/28944] strfmon field width is inconsistent with %f formatting
  2022-03-04  8:44 [Bug libc/28944] New: strfmon field width is inconsistent with %f formatting fweimer at redhat dot com
  2022-05-23  9:08 ` [Bug libc/28944] " cvs-commit at gcc dot gnu.org
@ 2023-02-06 17:57 ` carlos at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: carlos at redhat dot com @ 2023-02-06 17:57 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28944

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Florian Weimer from comment #0)
> strfmon field width currently counts bytes, not characters, unlike printf
> (bug 28943). This does not seem useful for localization purposes.
> 
> POSIX.1-2017 requires counting bytes.

If the standard says bytes then I think this should remain at bytes even though
it is less than useful for localization purposes.

In order to make a logical minimum column size the application will need to use
nl_langinfo to determine various parameters, count bytes, and then pass an
adjusted field width in bytes based on the application logic. It would be
easier to pass in a character count, but that is not the case today. The
standard would have to be expanded to have a "character count width" rather
than "width" in this case.

I'm of the opinion that this is likely a CLOSED / WONTFIX, but that this bug
can be used to document the current implementation position on the issue.

Note: Even for %s/%S there is confusion in the standard about "characters
(bytes)" which means the word "character" is often used for the char type
rather than logical characters.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-06 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04  8:44 [Bug libc/28944] New: strfmon field width is inconsistent with %f formatting fweimer at redhat dot com
2022-05-23  9:08 ` [Bug libc/28944] " cvs-commit at gcc dot gnu.org
2023-02-06 17:57 ` carlos at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).