Liste des Groupes | Revenir à c arch |
On 16/09/2024 10:37, Terje Mathisen wrote:Is that true? I'll have to check godbolt myself if that is really the case!This becomes much simpler in Rust where usize is the only legal index type:I don't care much about the compiler - but I don't think this is an improvement for the programmer. (In general, I dislike trying to do too much in a single expression or statement, but some C constructs are common enough that I am happy with them. It would be hard to formulate concrete rules here.)
>
Yeah, you have to actually write it as
>
 y = p[x];
 x += 1;
>
instead of a single line, but this makes zero difference to the compiler, right?
>
And the resulting object code is less efficient than you get with signed int and "y = p[x++];" (or "y = p[x]; x++;") in C.
Les messages affichés proviennent d'usenet.