From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,HEADER_SPAM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-Thread: fc772,b30bd69fa8f63cb2 X-Google-Attributes: gidfc772,public X-Google-ArrivalTime: 2003-06-15 03:05:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uwm.edu!rpi!not-for-mail From: =?Windows-1252?Q?Terje_Sletteb=F8?= Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 15 Jun 2003 06:07:17 -0400 Organization: unknown Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> <9PWcnbLRQfCMCHajXTWcpQ@gbronline.com> NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Sun, 15 Jun 2003 05:16:03 +0200 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPuxFUEHMCo9UcraBAQHCqQIAhnHeRJA05Xrmml4kpH390+ks5H+QRNcD ItRsNOoHy1SvI9w4L5egoBZMuAxGX5gCIzER8T0zfTdURf0C9NWLCw== =8QJm Xref: archiver1.google.com comp.lang.ada:39194 comp.lang.c++.moderated:68391 Date: 2003-06-15T06:07:17-04:00 List-Id: "Wesley Groleau" wrote in message news:9PWcnbLRQfCMCHajXTWcpQ@gbronline.com... > > > > > If your suggestion was adopted, how would it affect existing > > > > programs? For that matter, why would you ever *want* > uninitialized > > > > variables? > > > > > > Reading from streams is an obvious example: > > > > > > int i; > > > > > > stream >> i; > > > > > > Intialising "i" beforehand would just be wasteful. > > I would think even a mediocre compiler would optimize away > an obiously useless initialization. I wouldn't count on that. Especially if the definition of istream.operator(int) is in another translation unit, it usually can't look across translation units at definitions, so it won't know what it does. Regards, Terje [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ] [ about comp.lang.c++.moderated. First time posters: do this! ]