On Fri, Jan 13, 2017 at 05:51:00PM -0800, Shu Shen wrote:
> Although ofp_port_t uses a 16-bit range, it is defined as a 32-bit type.
> The format strings throughout the code base were using PRIu16 for
> ofp_port_t which leads to the compiler to throw Wformat message on
> platforms that don't promote 16-bit to 32-bit integers, e.g., on macOS.
> 
> Signed-off-by: Shu Shen <[email protected]>

It makes sense to use PRIu32 for a 32-bit type, so I applied this to
master and branch-2.6.  Thank you.

But I don't understand the statement that Mac OS does not promote 16-bit
integer to 32-bit integers.  According to
https://developer.apple.com/library/content/documentation/Darwin/Conceptual/64bitPorting/transition/transition.html,
on Mac OS "short" is a 16-bit integer and "int" is a 32-bit integer.
Under C rules, unsigned types shorter than unsigned int are promoted to
unsigned int when they are passed as arguments, which means that on Mac
OS, 16-bit types are converted to 32-bit ones when they are passed as
arguments.  Am I missing something subtle?
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to