[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/toollog: Drop XTL_NEW_LOGGER()

Andrew Cooper writes ("Re: [PATCH] tools/toollog: Drop XTL_NEW_LOGGER()"):
> On 19/01/16 17:36, Ian Jackson wrote:
> > I think this macro is useful because if you wanted to write (say)
> > xtl_logger_syslog, you would want to use it to help you with some
> > boilerplate.
> WTF? Even documented, the behaviour of this macro is insane, which is
> why I am trying to kill it.  After this, I will also be fixing the gross
> pointer abuse which exists in the xentoollog internals, before the ABI
> becomes fixed in 4.7.

I think the behaviour of this macro is perfectly sane.

I think your reference to `gross pointer abuse' is to the casting from
the specific to the generic struct.  This is a completely standard
technique for oopy stuff in C.  Here is a whole library (quite a nice
neat library, in fact) that uses it:

> Irrespective of whether you disagree with my opinions here, xentoollog.h
> is specified to be C99 -strict, meaning no GNUisms.

Specified where ?

Anyway, there is no requirement to use this macro.  If someone wants
to write a strict C99 xtl logger then they can do it by hand.  (I
predict that no-one will want to do that.)  So there is clearly no
actual reason why this macro ought to be pure C99.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.