- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to pass NULL as an argument to a function whic...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2010 12:56 AM
01-06-2010 12:56 AM
How to pass NULL as an argument to a function which expects "va_list" type in HP-IA
I am trying to compile a CPP program in HPIA64 using aCC 6.* compiler.
The function definition as below:
--------------------------------
void RtEventLog::
CopyMail(RtEventLog::LogEventSeverity Severity,
RtEventLog::mailTypes Type,
DWORD MsgId,
const TCHAR * MsgFmt,
va_list MsgArgs,
const TCHAR * MsgText)
Function call :
---------------
CopyMail(Severity, mailTypeText, 0, NULL, NULL, Text);
FYI : assuem #define NULL 0.
Now, When we pass NULL as an argument to the function call, it is being substituted as 0 and it is not getting converted into va_list type. Please help since it is very urgent.
We tried:
--------
Created an va_list variable as
va_list ap={};
CopyMail(Severity, mailTypeText, 0, (const TCHAR *)NULL, ap, Text);
But it did not work.
Thanks in Advance
- Tags:
- va_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2010 01:37 AM - edited 08-27-2011 04:43 AM
01-06-2010 01:37 AM - edited 08-27-2011 04:43 AM
Re: How to pass NULL as an argument to a function which expects "va_list" type on IA64
What you are doing is illegal and non-portable. You can not fiddle with a va_list since it is an opaque thingee. You can only pass it as a parm or assign (possibly with va_copy) or use it in other va_* functions.
In fact on x86-64, it is an array of a struct with 24 bytes.
>When we pass NULL as an argument to the function call, it is being substituted as 0 and it is not getting converted into va_list type.
It would help if you supplied the error message to make sure we are talking about the same thing.
>Created an va_list variable as: va_list ap={};
>But it did not work.
Not work how? That was kludge I have mentioned before. Of course you will have problems "testing" it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 09:00 AM
01-07-2010 09:00 AM
Re: How to pass NULL as an argument to a function which expects "va_list" type in HP-IA
Thanks for your response.. The original error which i got is pasted below.
./RtEvtLog.CPP", line 1340: error #2304: no instance of overloaded function "RtEventLog::CopyMail" matches the argument
list
argument types are: (RtEventLog::LogEventSeverity, RtEventLog::mailTypes, int, int, int, const TCHAR *)
CopyMail(Severity, mailTypeText, 0, 0, 0, Text);
Please suggest the solution to pass a NULL to the va_list..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2010 01:36 AM - edited 08-27-2011 04:44 AM
01-08-2010 01:36 AM - edited 08-27-2011 04:44 AM
Re: How to pass NULL as an argument to a function which expects "va_list" type on IA64
>The original error
Yes, this is what you get if you have overloaded the function. What you are doing is illegal. There is no va_list constructor that takes an int.
I now need to see what you get for your "ap" workaround.
>Please suggest the solution to pass a NULL to the va_list..
As I said before, the Standard does NOT allow you to do this portably. You should consider some other mechanism. (Have you thought of how you are going to test for NULL?)