by nyanpasu64 · 4y ago · 0 comments
- Does this falsely raise buffer overflow errors for T with flexible array members where the actual allocation is bigger than the T?
- On a related note, is it even legal to memcpy more than a T's worth of data into a T
? (IMO you shouldn't be doing that, but I think it's legal in C, and not with my template trick.)- You can't take the address of a template function. What happens when you try to take &wmemcpy? Do you get a non-inlined wmemcpy with a failing branch which never knows the object size? A call to __builtin_dynamic_object_size? Or &__original_wmemcpy?
How can you know if it's a single `T` or an array of `T` objects? You can memcpy into an array of `T` through a `T*` with no limitation on the size. I don't see anything inherently wrong with that either.