Proposed platform assumption changes
nico at cryptonector.com
Tue Jan 31 16:42:41 EST 2012
On Tue, Jan 31, 2012 at 1:37 PM, Greg Hudson <ghudson at mit.edu> wrote:
> Summarizing this thread and the likely outcomes:
> * No one voiced concerns about assuming IPv6, variadic macros, and
> failure-free mutex locking and unlocking. So I think we're likely to
> assume those.
> * No one raised concerns about assuming POSIX signal support in Unix
> code, although it's worth noting that Windows has signal() but not
> sigaction(). It turns out we don't install signal handlers in any code
> built on Windows at the moment, so I think we're likely to assume POSIX
> signal support.
All the Unix-ish OSes you care about support POSIX signals, so there's
no reason to object to the use of POSIX signals as opposed to the old
Unix signal(2) interface.
However, as much as possible libraries should not use signals. Right
now the only use of signals in an MIT krb5 library is
krb5_prompter_posix(), which seems fair enough.
> * The idea of using an aborting malloc wrapper inside library code is
> * People would really like C99 designated initializers, but the ways of
> getting them (dumping MSVC) or sort of getting them (ugly macros) are
I've had to chase function calls across function tables/vtables/ops
vectors/whatever you want to call them a few times in the past two
days. Each time I want to chase something like "cache->ops->store" to
all the ccache store functions, say, I can't do it with a trivial
cscope symbol search. No, such searches are painful. I don't care
how ugly the macros are: they would make my life simpler. The lack of
support for this makes me wonder if I might be the only one in this
community using cscope.
There's another way though: at least for ops vectors you could have
the initializers generated by a script that generates code that the
compiler can consume, and if your compiler handles designated
initializers, then you get code that uses designated initializers. No
macros this way, but you have to build to find the struct initializers
(but that's already true for, e.g., error tables).
More information about the krbdev