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

--- Comment #17 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(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?

Even using uintmax_t may be insufficient. For instance, GCC has __uint128.

> 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.

Reply via email to