Date: Wed, 18 Jan 1995 22:00:29 +0300 From: "Andrew A. Chernov, Black Mage" <ache@astral.msk.su> To: freebsd-current@freefall.cdrom.com, freebsd-questions@freefall.cdrom.com, Sean Eric Fagan <sef@kithrup.com>, ugen@netvision.net.il Subject: Re: GCC bug again... Message-ID: <UBDLM7lib2@astral.msk.su> In-Reply-To: <199501181814.KAA24727@kithrup.com>; from Sean Eric Fagan at Wed, 18 Jan 1995 10:14:19 -0800 References: <199501181814.KAA24727@kithrup.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <199501181814.KAA24727@kithrup.com> Sean Eric Fagan writes:
>Ah ah. I see what he's saying. I compiled:
>extern long long lseek (int, long long, int);
>char buf[1023];
>int fd;
>foo() {
> lseek (fd, -sizeof(buf), 1);
>}
>with 'gcc -S' on a 1.1++ system, and this was the output:
> .file "t.c"
>gcc2_compiled.:
>___gnu_compiled_c:
>.text
> .align 2
>.globl _foo
> .type _foo,@function
>_foo:
> pushl %ebp
> movl %esp,%ebp
> pushl $1
> pushl $0 # <--- should be -1
> pushl $-1023
> pushl _fd
> call _lseek
> addl $16,%esp
>L1:
> leave
> ret
>Lfe1:
> .size _foo,Lfe1-_foo
>.comm _buf,1024
>.comm _fd,4
>If the second argument is cast to '(int)', then it Does The Right Thing.
>gcc-2.6.0 seems to do this, as well, so it is confused about *something*.
It is completely right behaviour, -unsigned undefined and
must be casted to -((off_t)unsigned).
--
Andrew A. Chernov : And I rest so composedly, /Now, in my bed,
ache@astral.msk.su : That any beholder /Might fancy me dead -
FidoNet: 2:5020/230.3 : Might start at beholding me, /Thinking me dead.
RELCOM Team,FreeBSD Team : E.A.Poe From "For Annie" 1849
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?UBDLM7lib2>
