From owner-freebsd-questions Wed Jan 18 11:14:49 1995 Return-Path: questions-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id LAA12206 for questions-outgoing; Wed, 18 Jan 1995 11:14:49 -0800 Received: from sovcom.kiae.su (sovcom.kiae.su [144.206.136.1]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id LAA12200; Wed, 18 Jan 1995 11:14:46 -0800 Received: by sovcom.kiae.su id AA21550 (5.65.kiae-2 ); Wed, 18 Jan 1995 22:04:28 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Wed, 18 Jan 95 22:04:28 +0300 Received: (from ache@localhost) by astral.msk.su (8.6.8/8.6.6) id WAA00619; Wed, 18 Jan 1995 22:00:30 +0300 To: freebsd-current@freefall.cdrom.com, freebsd-questions@freefall.cdrom.com, Sean Eric Fagan , ugen@netvision.net.il References: <199501181814.KAA24727@kithrup.com> In-Reply-To: <199501181814.KAA24727@kithrup.com>; from Sean Eric Fagan at Wed, 18 Jan 1995 10:14:19 -0800 Message-Id: Organization: Olahm Ha-Yetzirah Date: Wed, 18 Jan 1995 22:00:29 +0300 X-Mailer: Mail/@ [v2.31 FreeBSD] From: "Andrew A. Chernov, Black Mage" X-Class: Fast Subject: Re: GCC bug again... Lines: 49 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Length: 1271 Sender: questions-owner@FreeBSD.org Precedence: bulk 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