public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [libffi] variable arguments support
@ 2009-10-30 20:06 Adrien
  2009-10-31 18:29 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Adrien @ 2009-10-30 20:06 UTC (permalink / raw)
  To: libffi-discuss

Hi,

I am trying to call a function with variable arguments. The libffi
README in gcc-4.3 sources mentionned this wasn't possible yet. The
more recent libffi sources (latest tarball available) mention:

> There is no support for calling varargs functions.  This may work on
> some platforms, depending on how the ABI is defined, but it is not
> reliable.

Should I read that as "if this work for you, try lotto" or has there
been some actual effort towards that?
I tried a small test program on linux32, linux64 and sparc32 and it
worked each time. The code is available on vpaste.net[1] (simple
pastebin). I tried to make it long enough to trigger potential
problems but I don't know that much low-level stuff and I'm not sure
I'm testing for the right thing.

I'd like comments about this. I don't need extensive support but I
need at least linux32/64, win32/64 and (various) bsd (I'm writing a
desktop app).

Thanks.


[1] http://vpaste.net/nV629?

 ---

Adrien Nader

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [libffi] variable arguments support
  2009-10-30 20:06 [libffi] variable arguments support Adrien
@ 2009-10-31 18:29 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-10-31 18:29 UTC (permalink / raw)
  To: Adrien; +Cc: libffi-discuss

Adrien wrote:

> I am trying to call a function with variable arguments. The libffi
> README in gcc-4.3 sources mentionned this wasn't possible yet. The
> more recent libffi sources (latest tarball available) mention:
> 
>> There is no support for calling varargs functions.  This may work on
>> some platforms, depending on how the ABI is defined, but it is not
>> reliable.
> 
> Should I read that as "if this work for you, try lotto" or has there
> been some actual effort towards that?
> I tried a small test program on linux32, linux64 and sparc32 and it
> worked each time. The code is available on vpaste.net[1] (simple
> pastebin). I tried to make it long enough to trigger potential
> problems but I don't know that much low-level stuff and I'm not sure
> I'm testing for the right thing.
> 
> I'd like comments about this. I don't need extensive support but I
> need at least linux32/64, win32/64 and (various) bsd (I'm writing a
> desktop app).

I have never knowingly used any ABI that has a different calling
convention for varargs and non-varargs functions.  Such ABIs probably
exist, but I wouldn't worry too much about the possibility.

Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-31 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-30 20:06 [libffi] variable arguments support Adrien
2009-10-31 18:29 ` Andrew Haley

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).