Deutsch   English   Français   Italiano  
<20241127123616.00003269@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Wed, 27 Nov 2024 12:36:16 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <20241127123616.00003269@yahoo.com>
References: <vi54e9$3ie0o$1@dont-email.me>
	<vi56hi$3ie0o$2@dont-email.me>
	<vi57bh$3ip1o$2@dont-email.me>
	<vi58ba$3ie0o$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 27 Nov 2024 11:35:27 +0100 (CET)
Injection-Info: dont-email.me; posting-host="c566f9897da40014d74d1afaf0306fbc";
	logging-data="3558886"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/QH1tPI4fKNgz3irkVVaujFeReHsbEMWg="
Cancel-Lock: sha1:4mD4IP11KLPdMztdNFHLfbErFX4=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
Bytes: 1983

On Tue, 26 Nov 2024 16:42:34 -0300
Thiago Adams <thiago.adams@gmail.com> wrote:
> 
> 
> Yes..I realized now I am wrong. Considering function calls uses 
> registers I think the old C model works only when passing everything
> on stack.
> 
> 

"Old model" relies on programmer always using right types in the
function call. F(0) call Bart's example would not work even for calling
conventions in which both int and double passed on the same stack,
because [in typical pre-64-bit calling conventions] they don't occupy
the same space. For correct result you would have to write it as
F((double)0) or F(0.0).

Alternatively "old model" could work when all things that are allowed
to be passed as function parameters are of the same size. It seems,
that's what they had in ancestors of C language and probably in very
early versions of C as well. It was no longer a case in variant of the
language described by 1st edition of K&R.