<p dir="ltr">About the 2 ways of adding an enum:</p>
<p dir="ltr">The user can always specify an error handler to handle unknown values. The error handle can then handle the error value, or unknown value. </p>
<br><div class="gmail_quote">On Mon, 27 Apr 2015 09:05 Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 25 Apr 2015 14:11:32 +0000<br>
Jeroen Bollen <<a href="mailto:jbinero@gmail.com" target="_blank">jbinero@gmail.com</a>> wrote:<br>
<br>
> > I think that totally depends on how the interface is specified. This<br>
> > applies only to one of the two ways an <enum> can grow.<br>
><br>
> What other way can it grow? It can only grow bigger. If the application<br>
> isn't aware of new values added, it should output a warning or an error.<br>
<br>
These:<br>
<br>
On Wed, 22 Apr 2015 09:34:51 +0300<br>
Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>> wrote:<br>
<br>
> There are two ways to add values to an existing <enum>:<br>
><br>
> - Bumping the interface version, and ensuring the new values are used<br>
>   only with the appropriate runtime interface version.<br>
><br>
> - From the first definition of an interface, specify how unknown values<br>
>   should be handled. Otherwise users do not expect unknown values to<br>
>   appear.<br>
<br>
The latter case is where you do not want an automatic always-on warning<br>
or error.<br>
<br>
<br>
> On Fri, 24 Apr 2015 22:05 Bill Spitzak <<a href="mailto:spitzak@gmail.com" target="_blank">spitzak@gmail.com</a>> wrote:<br>
><br>
> > Since all the codegen packages that want to use this enum attribute have<br>
> > not been written yet I don't think back-compatibility is an issue. They<br>
> > are not using uint because they do not exist yet!<br>
<br>
Except if you happen to have an old libwayland which you develop your<br>
3rd party app against, for instance because you use a distribution that<br>
does not include a more recent version yet.<br>
<br>
Depending on the language, I suppose the breakage could go both ways?<br>
Is there a language where an enum is not allowed to be implicitly<br>
converted to a uint or int?<br>
<br>
<br>
Thanks,<br>
pq<br>
<br>
> > The C codegen can continue to ignore the enum, or use it in a way that<br>
> > does not break code that tries to pass an integer or the wrong enum.<br>
> ><br>
> > On 04/24/2015 12:07 AM, Pekka Paalanen wrote:<br>
> ><br>
> > > The purpose of docenum was purely for documentation. An API generator<br>
> > > must ignore all docenum annotations. This was the backward-compatible<br>
> > > addition.<br>
> > ><br>
> > > Any attribute that modifies the generated API in incompatible ways<br>
> > > cannot be added after the interface has been released as stable. If<br>
> > > your function argument was uint, and you change it to an enum in a<br>
> > > strictly typed language, does it not have a good chance of breaking<br>
> > > someone's build?<br>
> ><br>
<br>
</blockquote></div>