Skip to content
Snippets Groups Projects
  1. Sep 07, 2020
  2. Sep 05, 2020
  3. Sep 03, 2020
  4. Aug 21, 2020
    • Masahiro Yamada's avatar
      kconfig: qconf: replace deprecated QString::sprintf() with QTextStream · 510bc3cb
      Masahiro Yamada authored
      
      QString::sprintf() is deprecated in the latest Qt version, and spawns
      a lot of warnings:
      
        HOSTCXX scripts/kconfig/qconf.o
      scripts/kconfig/qconf.cc: In member function ‘void ConfigInfoView::menuInfo()’:
      scripts/kconfig/qconf.cc:1090:61: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1090 |      head += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                             ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc:1099:60: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1099 |     head += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                            ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc:1127:90: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1127 |   debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
            |                                                                                          ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc: In member function ‘QString ConfigInfoView::debug_info(symbol*)’:
      scripts/kconfig/qconf.cc:1150:68: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1150 |    debug += QString().sprintf("prompt: <a href=\"m%s\">", sym->name);
            |                                                                    ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc: In static member function ‘static void ConfigInfoView::expr_print_help(void*, symbol*, const char*)’:
      scripts/kconfig/qconf.cc:1225:59: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1225 |   *text += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                           ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      
      The documentation also says:
      "Warning: We do not recommend using QString::asprintf() in new Qt code.
      Instead, consider using QTextStream or arg(), both of which support
      Unicode strings seamlessly and are type-safe."
      
      Use QTextStream as suggested.
      
      Reported-by: default avatarRobert Crawford <flacycads@cox.net>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      510bc3cb
    • Masahiro Yamada's avatar
      kconfig: qconf: remove redundant help in the info view · 68fd110b
      Masahiro Yamada authored
      
      The same information is repeated in the info view.
      
      Remove the second one.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      68fd110b
    • Masahiro Yamada's avatar
      kconfig: qconf: remove qInfo() to get back Qt4 support · 53efe2e7
      Masahiro Yamada authored
      
      qconf is supposed to work with Qt4 and Qt5, but since commit
      c4f7398b ("kconfig: qconf: make debug links work again"),
      building with Qt4 fails as follows:
      
        HOSTCXX scripts/kconfig/qconf.o
      scripts/kconfig/qconf.cc: In member function ‘void ConfigInfoView::clicked(const QUrl&)’:
      scripts/kconfig/qconf.cc:1241:3: error: ‘qInfo’ was not declared in this scope; did you mean ‘setInfo’?
       1241 |   qInfo() << "Clicked link is empty";
            |   ^~~~~
            |   setInfo
      scripts/kconfig/qconf.cc:1254:3: error: ‘qInfo’ was not declared in this scope; did you mean ‘setInfo’?
       1254 |   qInfo() << "Clicked symbol is invalid:" << data;
            |   ^~~~~
            |   setInfo
      make[1]: *** [scripts/Makefile.host:129: scripts/kconfig/qconf.o] Error 1
      make: *** [Makefile:606: xconfig] Error 2
      
      qInfo() does not exist in Qt4. In my understanding, these call-sites
      should be unreachable. Perhaps, qWarning(), assertion, or something
      is better, but qInfo() is not the right one to use here, I think.
      
      Fixes: c4f7398b ("kconfig: qconf: make debug links work again")
      Reported-by: default avatarRonald Warsow <rwarsow@gmx.de>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      53efe2e7
  5. Aug 18, 2020
  6. Aug 17, 2020
  7. Aug 14, 2020
  8. Aug 12, 2020
Loading