int main(int, char**) { char i = 1; char j = 2; i ^= j; i |= j; i &= j;
return 0; } ----------------------------------- g++ -Wconversion main.cpp -o main ----------------------------------- main.cpp: In function âint main(int, char**)â: main.cpp:6: warning: conversion to âcharâ from âintâ may alter its value main.cpp:7: warning: conversion to âcharâ from âintâ may alter its value main.cpp:8: warning: conversion to âcharâ from âintâ may alter its value ----------------------------------- Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.2 (GCC) ----------------------------------- Linux archer 2.6.27-ARCH #1 SMP PREEMPT Fri Nov 28 10:35:44 UTC 2008 x86_64 Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz GenuineIntel GNU/Linux -- Summary: g++ -Wconversion warnings Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: revel at muub dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38522