Re: -Wconversion bug in g++-4.3?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Manuel López-Ibáñez writes:
 > For this testcase:
 > 
 > void g(const unsigned char b)
 > {
 >  unsigned short c = b & 0xff;
 > }
 > 
 > we get:
 > 
 > wconversion-3.c:3: warning: conversion to 'unsigned char' from 'int'
 > may alter its value
 > wconversion-3.c:3: warning: conversion to 'short unsigned int' from
 > 'int' may alter its value
 > 
 > Really weird... It is the same in both C and C++.

Please read http://gcc.gnu.org/wiki/NewWconversion.  Please come back
if you have any further questions.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux