Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101422

QString::vasprintf() doesn't support the '#' flag in format specifiers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.4
    • None
    • All

    Description

      Standard printf-family functions support a # modifier flag to format specifiers:

      1. Specifies that the value is to be converted to an
        alternative form. For o conversion, it shall increase the
        precision, if and only if necessary, to force the first
        digit of the result to be a zero (if the value and precision
        are both 0, a single 0 is printed). For x or X conversion
        specifiers, a non-zero result shall have 0x (or 0X) prefixed
        to it. For a, A, e, E, f, F, g, and G conversion specifiers,
        the result shall always contain a radix character, even if
        no digits follow the radix character. Without this flag, a
        radix character appears in the result of these conversions
        only if a digit follows it. For g and G conversion
        specifiers, trailing zeros shall not be removed from the
        result as they normally are. For other conversion
        specifiers, the behavior is undefined.
      (according to POSIX, anyway; and cppreference.com seems to agree).

      However, QString::vasprintf() does not support this modifier; hence, nor does either QString::asprintf() or qsnprintf().

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            Eddy Edward Welbourne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes