C++ Logo

sg12

Advanced search

Re: [ub] Undefined behaviour from uninitialised variables

From: Tony Van Eerd <tvaneerd_at_[hidden]>
Date: Thu, 31 Oct 2013 18:24:03 +0000
>
> >
> > I would like to understand how you would specify the effects of the
> > attribute (I'm not asking for *exact* standardese, just to get a
> > better understanding on what you expect from adding this attribute).
> >
> > Thanks,
> >
> > - Daniel
>
> My guess:
>
> int i; // ??? intentional ???
>
> int j [[uninitialized]]; // (no idea where the attribute goes)
>
> int k = 3;
>
> Compilers could aggressively warn about 'i' without warning about 'j';
>
> Tony
>

And to be specific: like all good attributes, it doesn't change how j behaves - i and j are the same from a standardese perspective.

Tony
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Received on 2013-10-31 19:24:20