Suggestion - new warning
U.Mutlu
um@mutluit.com
Mon Sep 22 15:41:31 GMT 2025
Jonathan Wakely wrote on 09/22/25 15:31:
> On Mon, 22 Sept 2025 at 10:49, U.Mutlu <um@mutluit.com> wrote:
>>
>> Yair Lenga via Gcc wrote on 09/22/25 08:29:
>>>
>>> I've inherited an old code base of "C" code, which was maintained by
>>> relatively inexperience team. One of the common pattern that I've seen was:
>>>
>>> for (int i=0 ; i < strlen(s) ; i++) { ... }
>>
>> Such code implies that the string can change between the loop iterations.
>> This of course is a legit use case.
>>
> Yes, that's the point of the original post. They're asking for a
> warning to tell developers not to do it.
But as said, in some use-cases such code is perfectly wanted/desired.
More information about the Gcc
mailing list