[Bug c/24542] potential unwanted truncation of operation overflow should be warned on assignment to wider variable

2023-08-07 Thread mail+gcc at nh2 dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24542 --- Comment #15 from Niklas Hambüchen --- Another common integer overflow bug type is the "for (u32 i = 0; i < u64; ++i)" pattern, as well as general widening comparisons. I filed bug 110933 for those; just linking it here for people interested

[Bug c++/110933] Add warning flags to check against integer overflow

2023-08-07 Thread mail+gcc at nh2 dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110933 --- Comment #1 from Niklas Hambüchen --- A tangentially related issue is bug 24542 which is about another common overflow bug, the pattern "u64 = u32 * u32". Just linking it here because people interested in solving integer overflow issues may

[Bug c++/110933] New: Add warning flags to check against integer overflow

2023-08-07 Thread mail+gcc at nh2 dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110933 Bug ID: 110933 Summary: Add warning flags to check against integer overflow Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3