This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
is it a bug?
- From: Denisss <denisss025 at gmail dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Mar 2008 20:57:57 +0300
- Subject: is it a bug?
- References: <1a57b36d0803141049q771b54d2gf886f3dc2788309d@mail.gmail.com>
Hello!
I don't know if it's a bug, but I send You a report.
I've got something like that in my code:
bool t = false;
if (t = true)
...
When I compile this with -Wall flag, compiler must show warning, but it doesn't!
g++ -Wall -o mytry mytry.cpp
When I change my code to something like that:
int t = 0;
if (t = 1)
...
GCC shows warning for the second line.
i586-mandriva-linux-gnu
../configure --prefix=/usr --libexecdir=/usr/lib --with-slibdir=/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-checking=release
--enable-languages=c,c++,ada,fortran,objc,obj-c++,java
--host=i586-mandriva-linux-gnu --with-cpu=generic --with-system-zlib
--enable-threads=posix --enable-shared --enable-long-long
--enable-__cxa_atexit__ --disable-lubunwind-exceptions
--enable-clocale=gnu --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--enable-gtk-cairo --enable-libjava-multilib --enable-ssp
--disable-libssp
gcc ver. 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)
Thanks.