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

Platforms still use the inefficient qvsnprintf() fall-back

    XMLWordPrintable

Details

    • Android, WebAssembly
    • 8
    • 3f54c71b7 (dev), 1aedd4d7c (dev), 6c21f8103 (6.8), c3477a737 (6.8), fce31df44 (6.7), 850e27668 (6.7), 4636c0212 (tqtc/lts-6.5), 2399caabf (tqtc/lts-6.5), 80d93bafc (tqtc/lts-6.2), 1162989eb (tqtc/lts-6.2), 6ce758ccb (dev), 5e947802b (6.8), 9633a296e (dev)
    • Foundation Sprint 112, Foundation Sprint 113

    Description

      qvsnprintf.cpp has a fall-back implementation in case QT_VSNPRINTF isn't defined by qplatformdefs.h. However, it's horribly slow: QString::asprintf().toLocal8Bit() + another memcy().

      The qplatformdefs.h's of affected platforms contain

      #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) 
      #define QT_SNPRINTF             ::snprintf
      #define QT_VSNPRINTF            ::vsnprintf
      #endif
      

      It seems we're either not setting the correct #define ahead of #include <unistd.h> or these #ifdef's are just outdated.

      Since we kinda require C99 these days, the function should be universally available.

      Acceptance criteria:

      • The fall-back is removed and replaced by
        #ifndef QT_VSNPRINTF
        #error Need to define QT_VSNPRINTF in qplatformdefs.h.
        #endif
        

      Attachments

        For Gerrit Dashboard: QTBUG-127110
        # Subject Branch Project Status CR V

        Activity

          People

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes