This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strstr.c:105:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode


Greetings,

On 8/13/19 4:00 AM, Corinna Vinschen wrote:
> I don't see any such patch in there fixing the undefined behaviour
> you're talking about:

Apologies for not making it clear. In my eyes the patch submitted still
had UB [using int instead of size_t with a potential integer overflow].

> These two hunks are just the pre-C99 drop-in replacement.
> Also:
> 
>     if (__builtin_expect (ne_len < 255, 1))
>       [...]
> 
> So ne_len is guaranteed to be < 255 in this code snippet.  Am I missing
> something?

And this is what I get for not reading the entire source file and only
looking into the patch... Sorry.

Cheers,
Orlando.

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]