<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">On 03/07/2019 01:13, Ondrej Pokorny
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:d0d30855-cc91-ada0-2af1-e39b09e5f9a8@kluug.net">On
02.07.2019 23:34, Jonas Maebe wrote:
<br>
<blockquote type="cite">As to your patch itself: why do you not
directly compare the tconstexprint values directly, and use the
svalue/uvalue fields instead?
<br>
</blockquote>
<br>
Because I missed that they can be directly compared directly.
<br>
</blockquote>
<p>I dare say, I would advise you make any new changes to my
"AS-IS-enum-04.patch", since that adds an internal error to one of
the case blocks (mostly to suppress a compiler warning) and
ensures it merges cleanly with the trunk.</p>
<p>I am with you that we need <i>something</i> to determine if an
enumeration is in range or not because of the common problem of
reading from a file.</p>
<p>Invalid data happens - to actually enforce that all behaviour is
undefined is VERY bad practice. There are some applications where
the program must be able to handle and recover erroneous inputs,
and a data file is one such source of errors - for example, a
program writes an enumeration to a file, and in a later version of
the program, you add a new value to the enumeration, and then try
to read that file in the old version of the program. You could
argue that it was a poor design choice to not include a version
field so you don't read such a value in the first place, but it's
too late to change that, and it still doesn't trap the case where
the file has been deliberately modified in an attempt to crash the
program. If a developer wishes to make their software robust, we
have no right to forbid it. Honestly, it just discourages the
language's use.</p>
<p>The "as" and "is" operators are the only 'exceptions' to the
language that would be required here. Range checks need not be
included in other conditions, and a single exception can be
documented.<br>
</p>
<p>Gareth aka. Kit<br>
</p>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>