This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

is it a bug?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]