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

QTypeRevision::fromVersion fails ( in debug mode ), when being fed with characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.5.7, 6.8.1, 6.9.0 FF
    • 6.7.2
    • Core: Other
    • None
    • gcc (Debian 12.2.0-14) 12.2.0
    • Linux/X11
    • ddfcc0734 (dev), a572b4b07 (dev), 43003ccbc (6.8), 4f30a4426 (6.8), 9aa8aa273 (6.7), 6547988c2 (6.7), 906fa7738 (tqtc/lts-6.5), d38b77fd1 (tqtc/lts-6.5)

    Description

      The following code runs into an assertion, when Qt has been built in debug mode.

      ( void )QTypeRevision::fromVersion( 'X', 'Y' );

      ASSERT: "isValidSegment(majorVersion)" in file /opt/qt/Qt-6.7.2d/include/QtCore/qtyperevision.h

      Obviously the template does not work properly for characters:

      ( int )std::numeric_limits<char>::max() -> 128
      ( int )char(0xff) -> -1

      Casting the characters to quint8 ( my workaround ) avoids the issue.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            uwe Uwe Rathmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: