Sujet : Re: question about linker
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 27. Nov 2024, 11:36:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241127123616.00003269@yahoo.com>
References : 1 2 3 4
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
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.