public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: Robert Kiesling <kiesling@earthlink.net>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Variable function arguments and the stack
Date: Thu, 06 Dec 2007 00:11:00 -0000	[thread overview]
Message-ID: <47573DE4.7000508@avtrex.com> (raw)
In-Reply-To: <E1J04AO-0002wi-77@owl.gateway.2wire.net>

Robert Kiesling wrote:
> I trying to write a function that calls libc functions with
> variable arguments - for example, scanf.  I would like to do
> this by pushing the arguments onto the stack and then calling 
> the function, something like this.  (This code is for an x86
> machine.)
> 
> static long long int scalar_args[512];
> static char *ptr_args[512][BUFSIZE];

Use libffi which ships with GCC.  Doing things like this is what it was 
designed for.

David Daney

  reply	other threads:[~2007-12-06  0:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06  0:00 Robert Kiesling
2007-12-06  0:11 ` David Daney [this message]
2007-12-06  0:41   ` Robert Kiesling
2007-12-09 14:30 Robert Kiesling
2007-12-15  8:30 ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47573DE4.7000508@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=kiesling@earthlink.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).