public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94767] New: (unsigned bitfield) + (int) operation results in int, not unsigned int.
@ 2020-04-26  2:08 jh718.park at samsung dot com
  2020-04-26  8:41 ` [Bug c++/94767] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jh718.park at samsung dot com @ 2020-04-26  2:08 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-27 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26  2:08 [Bug c++/94767] New: (unsigned bitfield) + (int) operation results in int, not unsigned int jh718.park at samsung dot com
2020-04-26  8:41 ` [Bug c++/94767] " pinskia at gcc dot gnu.org
2020-04-27  6:40 ` rguenth at gcc dot gnu.org
2020-04-27  8:36 ` redi at gcc dot gnu.org
2020-04-27 10:03 ` jh718.park at samsung dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).