https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94767

            Bug ID: 94767
           Summary: (unsigned bitfield) + (int) operation results in int,
                    not unsigned int.
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jh718.park at samsung dot com
  Target Milestone: ---

For these variables below,

unsigned m_schemeEnd : 26;
unsigned m_userStart;

m_userStart == m_schemeEnd + 1

this comparison emits a compiler warning as below.

warning: comparison of integer expressions of different signedness: ‘unsigned
int’ and ‘int’ [-Wsign-compare]

This bug was found during WebKit gtk port build with gcc 9.3.0.

Temporarily, this warning was removed by this patch,
https://trac.webkit.org/changeset/260715/webkit
like

bool slashSlashNeeded = m_userStart == static_cast<unsigned>(m_schemeEnd + 1);

but we think that this bug should be fixed in gcc.

Reply via email to