- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how can we assign NULL value to va_list variable i...
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
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
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
тАО03-11-2008 04:38 AM
тАО03-11-2008 04:38 AM
how can we assign NULL value to va_list variable in HPUX itanium..
I have written a function which takes variable argument as one of the input, and i want to pass NULL argument in as input, but getting following error message
Illegal cast expression; cannot cast expression type 'long' to '__va_list__
can you please help me resolving the problem.
function is of type
fun(char *a, va_list valist);
and calling function call it as
fun(a,NULL);
Thanks for the help in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2008 08:03 AM
тАО03-11-2008 08:03 AM
Re: how can we assign NULL value to va_list variable in HPUX itanium..
Since va_list is a thingy, you can't assign a NULL. Basically va_list is a C++ class that has no constructors, no operator==, no operator void*, etc. It only has copy constructor and copy assignment operator.
You can only use va_start, va_arg, (va_copy on C99) and va_end. See the following:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1207141
The only way to initialize to 0 is with a hammer for lvalues or a static variable or with this C++ construct for locals: va_list ap = {};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2008 10:41 PM
тАО03-11-2008 10:41 PM
Re: how can we assign NULL value to va_list variable in HPUX itanium..
I just checked the link
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1207141
and have a doubt here. If i use sth like
#ifdef FIX
static va_list va_NULL;
#endif
#ifdef FIX
void sam(va_list ap = va_NULL)
#else
void sam(va_list ap = NULL)
#endif
and if try to use va_list variable ap with va_args, will it work properly since we have not initialized static variable va_NULL but have assigned it to va_list variable ap. If it works properly i think it will solve my problem, if not how to deal with this scenario.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2008 11:48 PM
тАО03-11-2008 11:48 PM
Re: how can we assign NULL value to va_list variable in HPUX itanium..
Static POD variables are default initialized to 0.
You will have similar problems testing your parm against NULL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-12-2008 06:55 AM
тАО03-12-2008 06:55 AM
Re: how can we assign NULL value to va_list variable in HPUX itanium..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2008 03:36 AM
тАО03-13-2008 03:36 AM
Re: how can we assign NULL value to va_list variable in HPUX itanium..
If this answers your questions, you should read the following about assigning points and reopening threads:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
http://forums.itrc.hp.com/service/forums/helptips.do?#41