From ac129807d135eccf94de16bfc4338130c332786d Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Fri, 16 Oct 2026 13:16:36 +0100 Subject: [PATCH] Replace erroneous use of overflow Modulo behaviour of unsigned integers appears to be referred to as overflow. However, [unsigned integers don't overflow](https://eel.is/c++draft/basic.fundamental#note-1). Replaced "overflow behavior" with "modulo behavior". --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 34addb87f..a9da37155 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -13578,7 +13578,7 @@ but if you had seen `us - (s + 2)` or `s += 2; ...; us - s`, would you reliably ##### Exception Use unsigned types if you really want modular arithmetic - add -comments as necessary noting the reliance on overflow behavior, as such code +comments as necessary noting the reliance on modulo behavior, as such code is going to be surprising for many programmers. ##### Example