Closed gperciva closed 11 months ago
I received an email pointing out flaws in my previous commit message.
Rebased the PR. There's now a rather vague commit message:
Using a flag will probably generate better code than indirecting via a function pointer, and some compilers object to using a function pointer to refer to both:
ssize_t send(int s, const void *msg, size_t len, int flags);
ssize_t recv(int s, void *buf, size_t len, int flags);
Rebased, updated commit message.
Since the commit messages are primarily for us, I went with more detail than you proposed. If the question came up again, I didn't want to be digging through github discussions to find that info.
If you really don't like it, I'll prune it down to what you wrote last night.
New commit message:
Some compilers object to using a function pointer which can point to functions which have different const qualifiers, i.e.
This is allowed:but that's a somewhat esoteric detail.
Also, using a flag might generate better code than indirecting via a function pointer.
Reported by: clang-16
EDIT: "pointer to qualified T" is not compatible with "pointer to T", which is the issue with "void msg" v "const void msg".