Subject: Re: libpthread.so.1.60 on NetBSD 1.3.3
To: Roger Brown <rogerhb@xtra.co.nz>
From: Andy Finnell <andyf@vei.net>
List: port-mac68k
Date: 09/07/1999 21:43:18
Roger Brown wrote:
> 
> The error from the compile is ...
> 
> cc -O -O -Werror  -I/usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6
> -I/u
> sr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/include
> -I/usr/pkgsrc/deve
> l/mit-pthreads/work/pthreads-1_60_beta6/include -DPTHREAD_KERNEL  -Werror
> -I/us
> r/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6
> -I/usr/pkgsrc/devel/mit-pth
> reads/work/pthreads-1_60_beta6/include
> -I/usr/pkgsrc/devel/mit-pthreads/work/pth
> reads-1_60_beta6/include -DPTHREAD_KERNEL -c
> /usr/pkgsrc/devel/mit-pthreads/work
> /pthreads-1_60_beta6/machdep.c
> cc1: warnings being treated as errors
> /usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c: In
> function `
> machdep_sys_ftruncate':
> /usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c:243:
> warning:
> type mismatch with previous external decl
> /usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c:233:
> warning:
> previous external decl of `__syscall'
> *** Error code 1
> 
> Here it does not mention 'machdep_sys_lseek' but this is the immediately
> preceeding function which defines __syscall.
> 
> On my machine if you have the code...
> 
> int a(char *p)
> {
>     extern char *f();
> 
>     p=f();
> }
> 
> int b(int c)
> {
>     c=f();
> }
> 
> It complains with
> 
> q.c: In function `b':
> q.c:10: warning: type mismatch with previous external decl
> q.c:3: warning: previous external decl of `f'
> 
> So here the function prototype for 'f()' is not only scoped within function
> 'a()' but appears to be acting globally.
> 
> Regards
> 
> Roger
> 

It sounds like an issue with NetBSD 1.3.X using gcc and not egcs.  After
looking at the Alpha port, it appears they get away with it because they
never reference __syscall() call again.  What happens if you declare
__syscall() inside of machdep_sys_ftruncate() the way it appears inside
of machdep_sys_lseek()?  Unfortunately I don't have a 1.3.X system to do
any these tests myself.  

Thanks,

	-andy