[Bug c++/115626] relax -Wsign-conversion when initializing from a literal

2024-06-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115626 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|UNCONFIRME

[Bug c++/115626] relax -Wsign-conversion when initializing from a literal

2024-06-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115626 --- Comment #3 from Andrew Pinski --- (In reply to Andrew Pinski from comment #2) > You can always do `~(cast)0` too. That is: __uint128_t t = ~(__uint128_t)0; does not warn.

[Bug c++/115626] relax -Wsign-conversion when initializing from a literal

2024-06-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115626 --- Comment #2 from Andrew Pinski --- >may not work reliably for types for which no literal suffixes exist (e.g.: >extended integer types) You can always do `~(cast)0` too.

[Bug c++/115626] relax -Wsign-conversion when initializing from a literal

2024-06-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115626 --- Comment #1 from Andrew Pinski --- -1ul and ~0ul are portable by the way.