On Fri, 29 Jan 2016, Cody Permann wrote:

> When reading the encoded length values back out of the stream, I've
> found it's important to cast those bytes to unsigned chars instead
> of reading them as chars in the general case.

Definitely, to be safe.  C doesn't specify whether plain "char" is
signed or unsigned, and if it's signed but you try to write something
too big to it, then "the value is implementation-defined".  So it's
*allowed* to still work, but not by any means guaranteed.

We should add those casts (I think reinterpret_cast<char&> and
reinterpret_cast<unsigned char&>?) to the test code.
---
Roy

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to