Message143099
> That has since been changed. I'm reading from POSIX.1-2008,
> which says:
I see.
> The warning against using values larger than 2**32 - 1 is still
> there, I presume because they would not fit in a 32-bit signed
> int.
I assume you mean 2**31 - 1.
> I take it you mean CMSG_FIRSTHDR here
Indeed.
> IIRC, I saw an implementation in old FreeBSD headers that did not
> check msg_controllen, and hence did not return NULL as RFC 3542
> requires.
Alright, that's all I wanted to know.
> That said, the fact remains that the compiler warning is spurious
> if msg_controllen can be signed on some systems, and I still
> don't think decreasing the robustness of the code (particularly
> against any future modifications to that code) just for the sake
> of silencing a spurious warning is a good thing to do. People
> can read the comment above the "offending" line and see that the
> compiler has got it wrong.
Well, the compiler does not get it wrong. If socklen_t is defined as
an unsigned int, it has no way of knowing that it might be defined as
signed int on other platforms. |
|
Date |
User |
Action |
Args |
2011-08-28 15:56:44 | neologix | set | recipients:
+ neologix, baikie |
2011-08-28 15:56:43 | neologix | link | issue12837 messages |
2011-08-28 15:56:43 | neologix | create | |
|