This is the mail archive of the gcc-help@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]

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


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]