Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Oct 1995 13:51:26 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        wollman@lcs.mit.edu (Garrett A. Wollman)
Cc:        terry@lambert.org, hackers@FreeBSD.ORG
Subject:   Re: SYSCALL IDEAS [Was: cvs commit: src/sys/kern sysv_msg.c sysv_sem.c sysv_shm.c]
Message-ID:  <199510272051.NAA23967@phaeton.artisoft.com>
In-Reply-To: <9510272033.AA23654@halloran-eldar.lcs.mit.edu> from "Garrett A. Wollman" at Oct 27, 95 04:33:51 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > But this implies that if there is not a prototype in scope, a function
> > that uses a type that is not correct without a prototype in scope should
> > not generate a bogus call reference.
> 
> Not at all.  IT IS THE CALLER'S RESPONSIBILITY TO PASS THE CORRECT
> TYPES AND ALWAYS HAS BEEN.

THEN PROTOTYPES SHOULD WARN AND NEVER COERCE.

> In particular, it is incorrect to call lseek() with a `where' argument
> of any type other than `off_t', and if a prototype is not in scope,
> the the programmer damn well better use a cast to ensure that the
> correct type is being used.

I agree, although I believe definine off_t as quad to be illegal.

> > That's an evil way to pass arguments, then.  8-(.
> 
> That's a fast way to pass arguments on a slow architecture.  If you
> don't like it, tough, because I /know/ that there are compilers out
> there that do this, or something nearly like it.  (And don't forget
> the SPARC, where under Sun's compiler all aggregates are passed by
> hidden reference.)

Sun is, at least, consistent.  You can predict without knowledge of
the compiler or the particular call stub implementation what the
arguments should be in assembler.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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