(unsigned + signed) should return unsigned int type as a common type defined by usual arithmetic conversions.
But gcc 9.3.0 returns signed int type for this case.
I filed a bug for this issue on gcc bugzilla,
To workaround this, I originally submitted the patch, http://svn.webkit.org/repository/webkit/trunk@260715,
but according to Darin's comment, use unsigned integer suffix instead of static_cast<unsigned>.
Created attachment 397614 [details]
Committed r260727: <https://trac.webkit.org/changeset/260727>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 397614 [details].
FYI, in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94767,
Jonathan Wakely left a comment for a c++ standard entry for this issue.
and the statement of this link is as below.
"A prvalue for an integral bit-field ([class.bit]) can be converted to a prvalue of type int if int can represent all the values of the bit-field; otherwise, it can be converted to unsigned int if unsigned int can represent all the values of the bit-field. If the bit-field is larger yet, no integral promotion applies to it. If the bit-field has an enumerated type, it is treated as any other value of that type for promotion purposes."
So I think gcc's build warning,
warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
was valid one and this patch could be a proper fix, not just a workaround.