Lurker News
Back to discussion

Comment by arestor

arestor2 replies#
It's C. If you have an array, you may only compare to one element behind the last. Everything else is undefined behavior. So a compiler may just "optimize" your >= to ==.
eridius1 reply#
No it won't. It's using pointers, not array indices. The compiler has no possible way of knowing that `pe` is the one-past-the-end address.
arestor1 reply#
It's still UB. The array could potentially be at the end of the address space...
eridius#
Well yes, it could, but that's not really an argument for saying that Ragel using == is just as good as using >=.
vbernat#
It's not an array. It's inside a large buffer allocated by nginx.