by kevin_thibedeau · 7mo ago · 0 comments
C23 updated the definition of the [] operator to disallow negative subscripts with array type. I think you have to explicitly convert the array to a pointer type now.
int a[2];
a[-1]; // not ok
(&a[0])[-1] // ok
C23: https://cstd.eisie.net/c2y.html#6.5.3.2best off having a bespoke type that understands how big the array its indexing is