Re: [xml] libxml2 API crazy?



I bet nobody would complain about documentation!

Normal people who value their time will. XML is the official data format
of planet Earth. Every programming platform must have a decent,
well-documented XML API if it is to survive.

I should point out that in practice the casting is not an issue even
if you are technically correct.  My C textbook says that one cannot
depend on the order of execution for "if" statements.  

I think they've made it standard:

http://stackoverflow.com/questions/628526/is-short-circuiting-boolean-operators-mandated-in-c-c-and-evaluation-order

And I understand about the structure padding argument -- in your
example (two ints) they would certainly pad exactly the same in the
real world or the real world would end as we know it.  In fact the
same type should always align the same.  If you mixed double and float
that is another story, they are often different.

Someone on this list said they've made it standard too.

On the other hand -- it never hurts to do it right.  If you wanted to
fix all the "if" statements that would be fine too :-)

The problem is not portability, people said all things that libxml2 uses
are standard, but lack of docs: without reading the libxml2 code, you
can't know what element types XML_ELEMENT_NODE, XML_TEXT_NODE structures
(xmlDoc, xmlNode, xmlAttr) correspond to, etc. There are lots upon lots
of quirks with xmlNodePtr:

https://github.com/lamefun/libxml2/blob/efd3b16f974d64e3dde05228a1ed9a70c9b4421e/include/libxml/tree.h#L580



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