Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 1995 10:14:19 -0800
From:      Sean Eric Fagan <sef@kithrup.com>
To:        freebsd-current@freefall.cdrom.com, freebsd-questions@freefall.cdrom.com, ugen@netvision.net.il
Subject:   Re: GCC bug again...
Message-ID:  <199501181814.KAA24727@kithrup.com>

next in thread | raw e-mail | index | archive | help
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*.

Sean.



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