digitalmars.D - default initializers
- imr1984 (4/4) Apr 08 2005 can we have a command line option to turn the code that creates the defa...
- Thomas Kuehne (26/30) Apr 08 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Walter (7/11) Apr 08 2005 defautl
can we have a command line option to turn the code that creates the defautl initializing of variables OFF? I personally never rely on it - I always initialize my variables explicitly if I know that they are going to be read from right away; and I worry that this implicit initialization would be inneficient
Apr 08 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 imr1984 schrieb am Fri, 8 Apr 2005 08:45:21 +0000 (UTC):can we have a command line option to turn the code that creates the defautl initializing of variables OFF? I personally never rely on it - I always initialize my variables explicitly if I know that they are going to be read from right away; and I worry that this implicit initialization would be inneficientMaybe support for "-Wuninitialized" and correct dataflow analysis in the compiler to remove unrequired initialization is better. (1) from: (1) to: (2) from: (2) to: TODO: * can turn out quite compilcated for some flowcharts - e.g. Object initializers * requires additon of _d_new... without the use of memset to the GC Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCVkuu3w+/yD4P9tIRAmVuAJsEPS/sqoTZxv5TYsRLXPfAB1s/xQCeLXwn 4Zxr2YNTzt7IHeugq53oS0I= =mVzl -----END PGP SIGNATURE-----
Apr 08 2005
"imr1984" <imr1984_member pathlink.com> wrote in message news:d35gb1$1uhf$1 digitaldaemon.com...can we have a command line option to turn the code that creates thedefautlinitializing of variables OFF? I personally never rely on it - I always initialize my variables explicitly if I know that they are going to beread fromright away; and I worry that this implicit initialization would beinneficient The optimizer will eliminate most redundant initializations, so there shouldn't be much of any efficiency problem.
Apr 08 2005