Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2002 11:42:47 -0700
From:      "David O'Brien" <obrien@FreeBSD.ORG>
To:        Akinori MUSHA <knu@iDaemons.org>
Cc:        Bill Fenner <fenner@research.att.com>, rivers@dignus.com, audit@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: moused(8): char signed-ness problem with gcc 3.1
Message-ID:  <20020516114247.A67791@dragon.nuxi.com>
In-Reply-To: <86k7q48h2w.wl@archon.local.idaemons.org>; from knu@iDaemons.org on Thu, May 16, 2002 at 08:31:19PM %2B0900
References:  <200205160346.UAA27116@windsor.research.att.com> <86k7q48h2w.wl@archon.local.idaemons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 16, 2002 at 08:31:19PM +0900, Akinori MUSHA wrote:
> > > So - yes - it seems gcc 3.1 does have a problem...
> > Indeed - easily determined by breaking down the expression.
> > So, who's gonna report it to gcc-bugs?  knu?...

Specifically what is the problem?  Given the program below, take the
ISO-C spec and explain the problem.  Or even w/o the spec -- I haven't
been reading this thread.

> > int
> > main()
> > {
> >    unsigned char i = 127;
> >    char j;
> > 
> >    printf("%d\n", ((char)(i << 1)));
> >    j = ((char)(i << 1)) / 2;
> >    printf("%d\n", j);
> >    j = ((char)(i << 1));
> >    printf("%d\n", j / 2);
> >    return 0;
> > }
> 
> Somehow, specifying -fsigned-char, which I thought was the default,
> fixed the problem.  So, the cause may be in our configuration of gcc?

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020516114247.A67791>