Topic: Safer C++: never allow implicitly uninitialized variables?


Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Fri, 5 Dec 2014 22:10:24 -0800 (PST)
Raw View
------=_Part_1799_1323316710.1417846224433
Content-Type: multipart/alternative;
 boundary="----=_Part_1800_1643296638.1417846224433"

------=_Part_1800_1643296638.1417846224433
Content-Type: text/plain; charset=UTF-8

Hello everyone,

I wonder if it would make sense to make variables in C++ automatically
value-initialized or there would be problems.

Since we are making c++ safer and safer, would it make sense to do the
following?


int a; //value-initialized to 0

Later, some syntax like in D language could be provided:

int a = void;


The rationale behind this change would be:

- an uninitialized variable that is replaced by these new semantics does
not produce incorrect behaviour.
- makes the language safer to use.

In the case where performance must be preserved, a compiler option with the
old semantics would be enough.

Would this make any sense or I am missing manu points? It looks to me that
this could be backwards-compatible
and the noly thing that could happen is a performance bug, which can be
solved replacing iniitialization or by a
compiler switch for large codebases.



--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1800_1643296638.1417846224433
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello everyone,<div><br></div><div>I wonder if it would ma=
ke sense to make variables in C++ automatically value-initialized or there =
would be problems.</div><div><br></div><div>Since we are making c++ safer a=
nd safer, would it make sense to do the following?</div><div><br></div><div=
><br></div><div>int a; //value-initialized to 0</div><div><br></div><div>La=
ter, some syntax like in D language could be provided:</div><div><br></div>=
<div>int a =3D void;</div><div><br></div><div><br></div><div>The rationale =
behind this change would be:</div><div><br></div><div>- an uninitialized va=
riable that is replaced by these new semantics does not produce incorrect b=
ehaviour.</div><div>- makes the language safer to use.</div><div><br></div>=
<div>In the case where performance must be preserved, a compiler option wit=
h the old semantics would be enough.</div><div><br></div><div>Would this ma=
ke any sense or I am missing manu points? It looks to me that this could be=
 backwards-compatible</div><div>and the noly thing that could happen is a p=
erformance bug, which can be solved replacing iniitialization or by a</div>=
<div>compiler switch for large codebases.</div><div><br></div><div><br></di=
v><div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1800_1643296638.1417846224433--
------=_Part_1799_1323316710.1417846224433--

.


Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Sat, 6 Dec 2014 13:13:31 +0700
Raw View
--001a113d2eaee9df4b05098618f1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

P.S.: sorry for the typos.

2014-12-06 13:10 GMT+07:00 Germ=C3=A1n Diago <germandiago@gmail.com>:

> Hello everyone,
>
> I wonder if it would make sense to make variables in C++ automatically
> value-initialized or there would be problems.
>
> Since we are making c++ safer and safer, would it make sense to do the
> following?
>
>
> int a; //value-initialized to 0
>
> Later, some syntax like in D language could be provided:
>
> int a =3D void;
>
>
> The rationale behind this change would be:
>
> - an uninitialized variable that is replaced by these new semantics does
> not produce incorrect behaviour.
> - makes the language safer to use.
>
> In the case where performance must be preserved, a compiler option with
> the old semantics would be enough.
>
> Would this make any sense or I am missing manu points? It looks to me tha=
t
> this could be backwards-compatible
> and the noly thing that could happen is a performance bug, which can be
> solved replacing iniitialization or by a
> compiler switch for large codebases.
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a113d2eaee9df4b05098618f1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">P.S.: sorry for the typos.</div><div class=3D"gmail_extra"=
><br><div class=3D"gmail_quote">2014-12-06 13:10 GMT+07:00 Germ=C3=A1n Diag=
o <span dir=3D"ltr">&lt;<a href=3D"mailto:germandiago@gmail.com" target=3D"=
_blank">germandiago@gmail.com</a>&gt;</span>:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">Hello everyone,<div><br></div><div>I wonder if it wou=
ld make sense to make variables in C++ automatically value-initialized or t=
here would be problems.</div><div><br></div><div>Since we are making c++ sa=
fer and safer, would it make sense to do the following?</div><div><br></div=
><div><br></div><div>int a; //value-initialized to 0</div><div><br></div><d=
iv>Later, some syntax like in D language could be provided:</div><div><br><=
/div><div>int a =3D void;</div><div><br></div><div><br></div><div>The ratio=
nale behind this change would be:</div><div><br></div><div>- an uninitializ=
ed variable that is replaced by these new semantics does not produce incorr=
ect behaviour.</div><div>- makes the language safer to use.</div><div><br><=
/div><div>In the case where performance must be preserved, a compiler optio=
n with the old semantics would be enough.</div><div><br></div><div>Would th=
is make any sense or I am missing manu points? It looks to me that this cou=
ld be backwards-compatible</div><div>and the noly thing that could happen i=
s a performance bug, which can be solved replacing iniitialization or by a<=
/div><div>compiler switch for large codebases.</div><span class=3D"HOEnZb">=
<font color=3D"#888888"><div><br></div><div><br></div><div><br></div></font=
></span></div><span class=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113d2eaee9df4b05098618f1--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sat, 6 Dec 2014 11:34:16 +0200
Raw View
On 6 December 2014 at 08:10, Germ=C3=A1n Diago <germandiago@gmail.com> wrot=
e:
> Hello everyone,
>
> I wonder if it would make sense to make variables in C++ automatically
> value-initialized or there would be problems.

Oh, you mean
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/CuxYuf7fSUc/YrRM=
JzrXrO8J

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: "Daniel Gutson" <danielgutson@gmail.com>
Date: Sat, 6 Dec 2014 13:52:21 +0000
Raw View
--part4163-boundary-1529832253-1049971132
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

By initializing variables with an arbitrary (initial) value (which may not =
make sense in the semantic of your application), you are only adding perfor=
mance overhead, whereas usage of uninitialized variables can already be det=
ected in most cases by stating checking of most toolchains/static detection=
 tools.
If your compiler doesn't warn you about such cases, ask your compiler vendo=
r rather to try to change the std affecting the rest of people who uses mod=
ern compilers or checkers.
I suggest you to use lint-like tools and enable all the warnings of your co=
mpiler.

  Daniel.
-----Original Message-----
From: Germ=C3=A1n Diago <germandiago@gmail.com>
Date: Fri, 5 Dec 2014 22:10:24=20
To: <std-proposals@isocpp.org>
Reply-To: std-proposals@isocpp.org
Subject: [std-proposals] Safer C++: never allow implicitly uninitialized va=
riables?

Hello everyone,

I wonder if it would make sense to make variables in C++ automatically=20
value-initialized or there would be problems.

Since we are making c++ safer and safer, would it make sense to do the=20
following?


int a; //value-initialized to 0

Later, some syntax like in D language could be provided:

int a =3D void;


The rationale behind this change would be:

- an uninitialized variable that is replaced by these new semantics does=20
not produce incorrect behaviour.
- makes the language safer to use.

In the case where performance must be preserved, a compiler option with the=
=20
old semantics would be enough.

Would this make any sense or I am missing manu points? It looks to me that=
=20
this could be backwards-compatible
and the noly thing that could happen is a performance bug, which can be=20
solved replacing iniitialization or by a
compiler switch for large codebases.



--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--part4163-boundary-1529832253-1049971132
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><=
meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type"></h=
ead><body>By initializing variables with an arbitrary (initial) value (whic=
h may not make sense in the semantic of your application), you are only add=
ing performance overhead, whereas usage of uninitialized variables can alre=
ady be detected in most cases by stating checking of most toolchains/static=
 detection tools.<br/>If your compiler doesn't warn you about such cases, a=
sk your compiler vendor rather to try to change the std affecting the rest =
of people who uses modern compilers or checkers.<br/>I suggest you to use l=
int-like tools and enable all the warnings of your compiler.<br/><br/>  Dan=
iel.<hr/><div><b>From: </b> Germ=C3=A1n Diago &lt;germandiago@gmail.com&gt;
</div><div><b>Date: </b>Fri, 5 Dec 2014 22:10:24 -0800 (PST)</div><div><b>T=
o: </b>&lt;std-proposals@isocpp.org&gt;</div><div><b>ReplyTo: </b> std-prop=
osals@isocpp.org
</div><div><b>Subject: </b>[std-proposals] Safer C++: never allow implicitl=
y uninitialized variables?</div><div><br/></div><div dir=3D"ltr">Hello ever=
yone,<div><br></div><div>I wonder if it would make sense to make variables =
in C++ automatically value-initialized or there would be problems.</div><di=
v><br></div><div>Since we are making c++ safer and safer, would it make sen=
se to do the following?</div><div><br></div><div><br></div><div>int a; //va=
lue-initialized to 0</div><div><br></div><div>Later, some syntax like in D =
language could be provided:</div><div><br></div><div>int a =3D void;</div><=
div><br></div><div><br></div><div>The rationale behind this change would be=
:</div><div><br></div><div>- an uninitialized variable that is replaced by =
these new semantics does not produce incorrect behaviour.</div><div>- makes=
 the language safer to use.</div><div><br></div><div>In the case where perf=
ormance must be preserved, a compiler option with the old semantics would b=
e enough.</div><div><br></div><div>Would this make any sense or I am missin=
g manu points? It looks to me that this could be backwards-compatible</div>=
<div>and the noly thing that could happen is a performance bug, which can b=
e solved replacing iniitialization or by a</div><div>compiler switch for la=
rge codebases.</div><div><br></div><div><br></div><div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

</body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--part4163-boundary-1529832253-1049971132--


.


Author: "Ivan =?utf-8?B?xIx1a2nEhw==?=" <ivan.cukic@gmail.com>
Date: Wed, 10 Dec 2014 00:12:11 +0100
Raw View
> I wonder if it would make sense to make variables in C++ automatically
> value-initialized or there would be problems.

Hi,

Another work-around which is beoming more popular lately is to use auto as the
type specifier. In that case, you are forced to explicitely initialize the
variable.

This is, IMO, safer than initializing it to a compiler-chosen value (or a
default-constructed one).


--
Cheerio,
Ivan


KDE, ivan.cukic at kde.org, http://ivan.fomentgroup.org/
gpg key id: 850B6F76, keyserver.pgp.com

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: german.gomez@personifyinc.com
Date: Wed, 10 Dec 2014 18:46:59 -0800 (PST)
Raw View
------=_Part_5318_1757778514.1418266019863
Content-Type: multipart/alternative;
 boundary="----=_Part_5319_50953019.1418266019864"

------=_Part_5319_50953019.1418266019864
Content-Type: text/plain; charset=UTF-8



On Saturday, December 6, 2014 8:52:25 PM UTC+7, dgutson wrote:
>
> By initializing variables with an arbitrary (initial) value (which may not
> make sense in the semantic of your application), you are only adding
> performance overhead,
>

 No, you are not adding ONLY performance overhead, you are adding safety
and giving the user the choice to escape from that perf overhead if needed,
as before. Exactly the same D lang does.


> whereas usage of uninitialized variables can already be detected in most
> cases by stating checking of most toolchains/static detection tools.
>

This is by QoI, it is not a standard guarantee.


> If your compiler doesn't warn you about such cases, ask your compiler
> vendor rather to try to change the std affecting the rest of people who
> uses modern compilers or checkers.
> I suggest you to use lint-like tools and enable all the warnings of your
> compiler.
>

 Well, I think you are missing my point. I know of all of this.

One of the driving principles of the committee is to make the language
easier to use for novices. I think to correct this could make it easier to
use and more difficult to misuse, IMO.


--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_5319_50953019.1418266019864
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, December 6, 2014 8:52:25 PM UTC+7, dg=
utson wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div>By initializi=
ng variables with an arbitrary (initial) value (which may not make sense in=
 the semantic of your application), you are only adding performance overhea=
d, </div></blockquote><div><br></div><div>&nbsp;No, you are not adding ONLY=
 performance overhead, you are adding safety and giving the user the choice=
 to escape from that perf overhead if needed, as before. Exactly the same D=
 lang does.</div><div>&nbsp;</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div>whereas usage of uninitialized variables can already be detected=
 in most cases by stating checking of most toolchains/static detection tool=
s.<br></div></blockquote><div><br></div><div>This is by QoI, it is not a st=
andard guarantee.</div><div>&nbsp;</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div>If your compiler doesn't warn you about such cases, ask your=
 compiler vendor rather to try to change the std affecting the rest of peop=
le who uses modern compilers or checkers.<br>I suggest you to use lint-like=
 tools and enable all the warnings of your compiler.<br></div></blockquote>=
<div><br></div><div>&nbsp;Well, I think you are missing my point. I know of=
 all of this.</div><div><br></div><div>One of the driving principles of the=
 committee is to make the language easier to use for novices. I think to co=
rrect this could make it easier to use and more difficult to misuse, IMO.</=
div><div>&nbsp;</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5319_50953019.1418266019864--
------=_Part_5318_1757778514.1418266019863--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Wed, 10 Dec 2014 20:50:21 -0600
Raw View
--089e0158b50cb92e050509e7d888
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 9 December 2014 at 17:12, Ivan =C4=8Cuki=C4=87 <ivan.cukic@gmail.com> wr=
ote:

> This is, IMO, safer than initializing it to a compiler-chosen value (or a
> default-constructed one).
>

+1 to explicit initialization over initializing to a compiler-chosen
value.  As I've said before, a compiler-chosen value only makes the code
more deterministic, not less buggy.

I'm not a big fan of auto everywhere, though.  Names are important...
--=20
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--089e0158b50cb92e050509e7d888
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On 9 December 2014 at 17:12, Ivan =C4=8Cuki=C4=87 <span dir=3D"ltr">&lt;<a =
href=3D"mailto:ivan.cukic@gmail.com" target=3D"_blank">ivan.cukic@gmail.com=
</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=3D":312" c=
lass=3D"a3s" style=3D"overflow:hidden">This is, IMO, safer than initializin=
g it to a compiler-chosen value (or a<br>
default-constructed one).<br></div></blockquote></div><br>+1 to explicit in=
itialization over initializing to a compiler-chosen value.=C2=A0 As I&#39;v=
e said before, a compiler-chosen value only makes the code more determinist=
ic, not less buggy.</div><div class=3D"gmail_extra"><br></div><div class=3D=
"gmail_extra">I&#39;m not a big fan of auto everywhere, though.=C2=A0 Names=
 are important...<br>-- <br><div class=3D"gmail_signature">=C2=A0Nevin &quo=
t;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"mailto:nevin@eviloverlord.com=
" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=C2=A0 (847) 691-1404</di=
v>
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0158b50cb92e050509e7d888--

.


Author: german.gomez@personifyinc.com
Date: Wed, 10 Dec 2014 18:54:23 -0800 (PST)
Raw View
------=_Part_5192_1540542653.1418266463648
Content-Type: multipart/alternative;
 boundary="----=_Part_5193_1837520739.1418266463648"

------=_Part_5193_1837520739.1418266463648
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Wednesday, December 10, 2014 6:15:15 AM UTC+7, Ivan =C4=8Cuki=C4=87 wrot=
e:
>
>
> Another work-around which is beoming more popular lately is to use auto a=
s=20
> the=20
> type specifier. In that case, you are forced to explicitely initialize th=
e=20
> variable.=20
>
> =20
 Well, it requires the use of auto. I can imagine style guides where auto=
=20
will be banned
most of the time for code clarity when reading.

This is, IMO, safer than initializing it to a compiler-chosen value (or a=
=20
> default-constructed one).=20
>

I think value-initialization should be the correct default, not a=20
compiler-chosen value.=20

> --=20
> Cheerio,=20
> Ivan=20
>
>
> KDE, ivan.cukic at kde.org, http://ivan.fomentgroup.org/=20
> gpg key id: 850B6F76, keyserver.pgp.com=20
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_5193_1837520739.1418266463648
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, December 10, 2014 6:15:15 AM UTC+7, =
Ivan =C4=8Cuki=C4=87 wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>Another work-around which is beoming more popular lately is to use auto=
 as the=20
<br>type specifier. In that case, you are forced to explicitely initialize =
the=20
<br>variable.
<br>
<br></blockquote><div>&nbsp;</div><div>&nbsp;Well, it requires the use of a=
uto. I can imagine style guides where auto will be banned</div><div>most of=
 the time for code clarity when reading.</div><div><br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px =
#ccc solid;padding-left: 1ex;">This is, IMO, safer than initializing it to =
a compiler-chosen value (or a=20
<br>default-constructed one).
<br></blockquote><div><br></div><div>I think value-initialization should be=
 the correct default, not a compiler-chosen value.&nbsp;</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px=
 #ccc solid;padding-left: 1ex;">--
<br>Cheerio,
<br>Ivan
<br>
<br>
<br>KDE, ivan.cukic at <a href=3D"http://kde.org" target=3D"_blank" onmouse=
down=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fkde.org\46s=
a\75D\46sntz\0751\46usg\75AFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA';return true;"=
 onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fkde.org=
\46sa\75D\46sntz\0751\46usg\75AFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA';return tr=
ue;">kde.org</a>, <a href=3D"http://ivan.fomentgroup.org/" target=3D"_blank=
" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fiv=
an.fomentgroup.org%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEQ6zTWT5_bZqFzMEzf=
dv0KptX1WA';return true;" onclick=3D"this.href=3D'http://www.google.com/url=
?q\75http%3A%2F%2Fivan.fomentgroup.org%2F\46sa\75D\46sntz\0751\46usg\75AFQj=
CNEQ6zTWT5_bZqFzMEzfdv0KptX1WA';return true;">http://ivan.fomentgroup.org/<=
/a>
<br>gpg key id: 850B6F76, <a href=3D"http://keyserver.pgp.com" target=3D"_b=
lank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%=
2Fkeyserver.pgp.com\46sa\75D\46sntz\0751\46usg\75AFQjCNEux-nX0GwFGmasIC4KTv=
CIME1TmA';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q=
\75http%3A%2F%2Fkeyserver.pgp.com\46sa\75D\46sntz\0751\46usg\75AFQjCNEux-nX=
0GwFGmasIC4KTvCIME1TmA';return true;">keyserver.pgp.com</a>
<br></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5193_1837520739.1418266463648--
------=_Part_5192_1540542653.1418266463648--

.