[Bug c++/92675] sign-conversion C++ unsigned int j = -1;

jg at jguk dot org gcc-bugzilla@gcc.gnu.org
Thu Nov 28 12:41:00 GMT 2019


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

--- Comment #6 from Jonny Grant <jg at jguk dot org> ---
Is the clearest way to write this as follows?
unsigned int j = (unsigned int)-1;

Likewise for the template example:

  U max = (U)-1;   // good


More information about the Gcc-bugs mailing list