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

qhash.h:561:17: alloc-size-larger-than warning

    XMLWordPrintable

Details

    • Linux/X11
    • 1acbcc318 (dev), 5f5daae04 (dev), af7bc16fc (6.5), 413fbcabb (6.5)

    Description

      During migration to g++ 12 I hit the warnings reported in QTBUG-105388. After upgrading to Qt 6.5.0 those are gone, but I still get one warning (multiple times from multiple locations in my code, this is one stack example but always on qhash.h:561):

      In member function '__ct ',
          inlined from 'detached' at []/include/QtCore/qhash.h:577:20,
          inlined from 'detach' at []/include/QtCore/qhash.h:941:75:
      []/QtCore/qhash.h:561:17: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
        561 |         spans = new Span[nSpans];
            |                 ^
      /usr/include/c++/12/new: In member function 'detach':
      /usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
      
        128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
            |                          ^
      

      This is using Qt 6.5.0, g++ 12.2.0 with LTO enabled.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            sjoubert Sylvain Joubert
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes