Liste des Groupes | Revenir à cl c |
On Tue, 26 Nov 2024 16:42:34 -0300I will write in my own words. Correct me if I make a mistake.
Thiago Adams <thiago.adams@gmail.com> wrote:>"Old model" relies on programmer always using right types in the
>
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.
>
>
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.
Les messages affichés proviennent d'usenet.