This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libffi] variable arguments support


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]