Il 04/12/2012 13:49, Eduardo Habkost ha scritto: > Well, the commit description says that "if you place each function in a > separate source file, object files for unused functions will not be > taken in", I don't see it as a requirement. In this case, pulling both > stubs is a feature: if a binary ends up using the vmstate_register stub, > we really want it to use the vmstate_unregister stub as well.
I think Eduardo is right. In the beginning I was thinking more of having one function per file, but then in some cases the functions are clearly related. For example, if you have monitor_printf/monitor_vprintf, you have two choices: - put both of them in the same file, as done here for vmstate. - put each in a separate file. In this case, it doesn't really make sense to implement only one, so the monitor_printf stub should use va_start/va_end to forward to monitor_vprintf. In the second case, the monitor_printf stub is not even a stub anymore, because the same function will always be usable. This makes it much better to put both of them in the same file, IMHO. Paolo