X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Sat, 30 Mar 2002 11:22:57 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <2561-Sat30Mar2002112257+0300-eliz@is.elta.co.il> X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: Dong Soo Kim In-reply-to: (message from Dong Soo Kim on Sat, 30 Mar 2002 09:28:45 +1100) Subject: Re: g++ Warnings References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Dong Soo Kim > Newsgroups: comp.os.msdos.djgpp > Date: Sat, 30 Mar 2002 09:28:45 +1100 > > I was just reading Stroustrup's book on C++ (3rd ed) and in it he says > that "int x=x;" should produce a warning in good compilers. > > Then to my surprise I found that g++ doesn't (both in MingW and Djgpp), > and silently ignores it. 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.)