🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42187

Constructing parameter lists

#42187
From: Anton Ertl
Date: Tue, 26 Dec 1995 00:00
26 lines
1663 bytes
I am working on an interpreter (written in GNU C) and would like to
add the ability to call (possibly dynamically linked) C library
functions. The problem is: How do I pass the parameters? I could add
hundreds of ways of calling functions with different parameter lists
to my interpreter; this would be inelegant, and, more seriously,
incomplete.

GNU C already offers a "function" builtin_apply for calling a function
with any kind of parameter list, but it does not offer a way to
construct such a parameter list (except by taking the parameters of
the present function). There is also varargs/stdarg for dissecting
argument lists.

Is there a way that I can use builtin_apply and the stuff that is used
to implement varargs/stdarg to portably call a function with a
paramter list determined at run-time? I have looked at the sources for
gcc for a few hours but have not come to any conclusion.

If not, what do you think about adding such capabilities to gcc? Is it
hard, ist it desirable, and how would one do it?

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Technical Details
Message-ID: <4bp9lr$g0n@news.tuwien.ac.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,dfcb9872cdff3e45,start
X-Google-Attributes: gid11318c,public
From: anton@a0.complang.tuwien.ac.at (Anton Ertl)
Subject: Constructing parameter lists
Date: 1995/12/26
Message-ID: <4bp9lr$g0n@news.tuwien.ac.at>
X-Deja-AN: 122884963
organization: Institut fuer Computersprachen, Technische Universitaet Wien
newsgroups: gnu.gcc.help