Moving the kernel to modern C
Moving the kernel to modern C
Posted Mar 1, 2022 23:32 UTC (Tue) by dvdeug (guest, #10998)In reply to: Moving the kernel to modern C by wtarreau
Parent article: Moving the kernel to modern C
It's certainly an extreme reaction for a relatively minor thing. In an object orientated language, if your function gets passed a object x of type t, if t can be inherited from, x.method can do anything, no matter what the code for t says.
Even in C, a + b can do quite a few different things. Off the top of my head, I can't tell you what happens if a is a signed int with a negative value and b is an unsigned int. I do recall that integer overflow is undefined behavior, which is all sorts of fun. If you know the underlying types and the type programmer was sane, extending + to new types shouldn't make things much more complex.
