This is C++, not C.
The affected portion of code is undocumented and also happily circumvents logic of other objects to overwrite their innards. Quickly grasping author’s intentions is therefore hard.
My first guess, without analyzing the code fully, is that the
tail parameter is meant to (optionally) reference list’s
tail member for overwriting. So it is meant to be
SListItem** instead of
SListItem*.
I think the idea is you are supposed to alter the memory at &tail with the q.tail contents. Maybe you could do that with some sort of memcopy instead of =?
Using
memmove to circumvent type system and force compiler to “shut up” on a correct error? As if
memmove in C++ wasn’t already questionable in most circumstances, that idea can be summed up as: I don’t understand this situation, so let’s just bulldoze over it — maybe the compiler will stop bothering me. No, this is not how this works. Forget about such ideas for the rest of your life.