<p dir="ltr">On 21 Apr 2015 09:18, "Pekka Paalanen" <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>> wrote:<br>
> Two things I came up with in the IRC discussion was that only <arg><br>
> types of int an uint are eligible for enums, and only uint for<br>
> bitfields. I think wayland-scanner should enforce that.</p>
<p dir="ltr">I just realised another aspect of this. Can a (non-bitfield) enum be used both as an int and a uint? So some *int* argument somewhere has enum="bla", and a *uint* argument somewhere else has enum="bla" as well. What about enums that list negative values, can they be used as uints? </p>
<p dir="ltr">I feel that this would be extremely prone to bugs, and in fact I think this is a situation where semantic information of enum style arguments can help catch bugs in C code (which so far we haven't seen yet in this debate). </p>
<p dir="ltr">Should this be enforced by the scanner? Or is there some crazy situation in which it makes sense? </p>