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]

[Bug c++/38522] New: g++ -Wconversion warnings


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


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