This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wconversion and signedness
- To: Alexandre Duret-Lutz <duret_g at epita dot fr>
- Subject: Re: -Wconversion and signedness
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 23 Jun 1999 13:34:02 -0300
- Cc: egcs at egcs dot cygnus dot com
- References: <199906231549.RAA21433@phobos.lrde.epita.fr>
On Jun 23, 1999, Alexandre Duret-Lutz <duret_g@epita.fr> wrote:
> Shouldn't egcs complain with -Wconversion on the following snippet :
> unsigned i = 2;
> unsigned j = -i;
Nope. Unary minus, when applied to an unsigned integral value i,
means unsigned `2^n - i', where `n' is the number of bits in the
unsigned type.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists