By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,264 Members | 1,755 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,264 IT Pros & Developers. It's quick & easy.

Passing ellipsis to C

P: n/a
Consider:

#include <syslog.h>

// Open syslog in constructor.

void
MyClass::
MyMemberFunction(...)
{
syslog(LOG_INFO,???);
}

Now I assume that syslog is a C function, using C type varargs, etc.
Is this correct? I want to pass the ellipsis to syslog. Can
I do this? How? I have heard that there might be an incompatibility.

Thanks for your help.
Mike.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mike - EMAIL IGNORED wrote:
Consider:

#include <syslog.h>
There is no such standard header. If you want us to consider it, you
need to explain what it contains.

// Open syslog in constructor.

void
MyClass::
MyMemberFunction(...)
{
syslog(LOG_INFO,???);
}

Now I assume that syslog is a C function, using C type varargs, etc.
Why do you assume that? There is no such _standard_ C function.
Is this correct? I want to pass the ellipsis to syslog. Can
I do this? How? I have heard that there might be an incompatibility.


There is no way to pass "whatever arguments were passed to me" down to
some other function that is also declared with ellipsis. It is usually
done by calling a different function, which is made to accept 'va_list'.
See an implementation of 'printf' as an example.

V
Jul 23 '05 #2

P: n/a
Mike - EMAIL IGNORED wrote:
Consider:

#include <syslog.h>

// Open syslog in constructor.

void
MyClass::
MyMemberFunction(...)
{
syslog(LOG_INFO,???);
}

Now I assume that syslog is a C function, using C type varargs, etc.
Is this correct? I want to pass the ellipsis to syslog. Can
I do this? How? I have heard that there might be an incompatibility.

Thanks for your help.
Mike.

Don't assume...
It is a C function that takes a format string (like printf).

Try 'man syslog' for details.

Seek help in one of the Linux development newsgroups
(comp.os.linux.development.apps or comp.os.linux.development.system).

Regards,
Larry
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.