News for hackers. Stuff that matters.
Re:Poll on macOS 10.12 is broken by kazinator on Tuesday October 11, 2016 @07:00PM (#12689217)
I don't dispute that certain structures can have additional members. A good example is "struct tm" from ISO C's <time.h>

Is there a blanket requirement somewhere in POSIX which says that whenever a structure may have members in addition to the required ones, these members must be initialized (and specifically to zero) when the application creates such a structure and passes it to a library function?

(If so, why are they repeating that requirement for struct sockaddr_in6?)

In any case, does the issue reproduce on FreeBSD? If I google for this bind problem, it only appears to be reported against Mac OS X, and no other Unix, historic or current.

Re:Poll on macOS 10.12 is broken by kazinator on Wednesday October 12, 2016 @12:34PM (#12694319)
Thinking I might be going "crazy", I raised this in comp.std.c. Long time regular J. K. whose opinions I can practically take as fact concurs with me.

https://groups.google.com/forum/#!topic/comp.std.c/zl15FkixB...

If a standard structure may have additional members, those do not have to be initialized by the program, unless the requirement is explicit somewhere. For example, we do not have to initialize members of "struct tm" other than the standard ones when calling asctime; there is no wording which absolves asctime of behaving as required if those members are not initialized.

The same reasoning applies to the POSIX bind function and the members of struct sockaddr_in. (But not struct sockaddr_in6, for which initialization requirements are specified).