[cfe-dev] Feature/opinion request

Matthieu Monrocq matthieu.monrocq at gmail.com
Fri Oct 12 09:48:18 PDT 2012


On Thu, Oct 11, 2012 at 9:44 PM, Jacob Carlborg <doob at me.com> wrote:

> On 2012-10-11 19:58, Matthieu Monrocq wrote:
>
>  I agree with David though, the problem of uninitialized integrals is
>> that they do not have any sentinel values (unlike pointers, by the way,
>> for which null initialization never hurts).
>>
>
> In D these are the default values for all types:
>
> http://dlang.org/type.html
>
> D always tries to use a sentinel value if possible. Unfortunately it's not
> for integer types.
>
> --
> /Jacob Carlborg
>

And I find this annoying. I would have preferred that they decided that  -
(2**(N-1)) be a sentinel value, since anyway it's a loosy value as you
cannot get its positive counterpart... But a "default" value ? Then it's
impossible to decide whether it's intentional or not that this default is
returned.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121012/0ee3d530/attachment.html>


More information about the cfe-dev mailing list