X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3CA6DDE5.A6B2A7E2@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: g++ Warnings References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 41 Date: Sun, 31 Mar 2002 10:08:44 GMT NNTP-Posting-Host: 12.90.167.175 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1017569324 12.90.167.175 (Sun, 31 Mar 2002 10:08:44 GMT) NNTP-Posting-Date: Sun, 31 Mar 2002 10:08:44 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Dong Soo Kim wrote: > > On Sat, 30 Mar 2002, Eli Zaretskii wrote: > > > It would be a very Bad Idea (tm) for GCC to flag those cases, since > > they are widely used to shut up compiler warnings about variables > > which the compiler things are used before they are initialized. > > (Compilers can err about this because they don't understand what > > range of values can certain variables have, and thus don't know what > > conditions could fire under what circumstances.) > > out of curiosity, could you give some examples of occasions you'd need > to use that technique? I think this will do it. There are probably simpler demos. void demo(void); { int status = 2; int whatever; while (status) { switch (status) { case 1: status = 0; do { whatever++; while (whatever < 2); break; case 2: status = 1; whatever = 0; break; default: break; } } } /* demo */ -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)