https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773
--- Comment #18 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to Vincent Lefèvre from comment #17) > (In reply to Segher Boessenkool from comment #15) > > A much better fix is > > > > void f1(long s, unsigned long u) { unsigned long su = s; if (su == u) g(); } > > But what if s is some arbitrary integer type, e.g. that comes from a library? You need to fix this per case. If there was a simple fix this PR would not even exist :-( > > Still much better is to not mixed signedness in types at all. > > One does not necessarily have the choice. The signedness of some types is > not specified. Do not mix signed, unsigned, and unspecified signedness type. This requires less sloppy API design, and you need to match impedance with other libraries in some places, sure. Same as always.