On 8/3/12 1:57 PM, Blake Kaplan wrote:
This is the second time this week that the prospect of replacing PRUintX in
favor of stdint types has come up on this newsgroup. The JS engine already
went through the pain of getting the include/type definition stuff right
across the various platforms, so I'm wondering if there's a reason to not move
to using them.
I think the original question brought up two issues:
1. Using PRTypes versus non-PRTypes (C or stdint) types
2. Using explicity-sized types: uint32_t versus unsigned int
re #2:
Google's C++ Style Guide recommends [1] using (plain) signed `int` for
most numbers (even sizes and loop counters that are always nonnegative).
Explicitly-sized stdint types are only used when integer size is
important. Unsigned ints are only used for bit-manipulation.
In contrast, Adobe's Flash Player team prefered explicitly-sized stdint
types everywhere. The thought was that this would make security audits
easier when looking for integer overflow or bitshifting bugs. Flash has
been ported to many different computer architectures and cross-platform
consistency is a high priority.
chris p.
[1]
https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Integer_Types
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform