HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: experiencing different behaviour for va_list i...
Operating System - Linux
1828623
Members
1345
Online
109983
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
02-25-2008 08:18 PM
02-25-2008 08:18 PM
experiencing different behaviour for va_list initialization with NULL on PA-RISC and IA64
When I try to initalize va_list with NULL as default argument in a function, I am getting error: default argument of type "long" is incompatible with parameter of type "va_list". But this work fine with PA-RISC
Could anybody explain. I can conclude I can't use NULL to initialize with NULL. But I want to know the reason. Is there any document to give more details on this.
Could anybody explain. I can conclude I can't use NULL to initialize with NULL. But I want to know the reason. Is there any document to give more details on this.
- Tags:
- va_list
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 09:03 PM
02-25-2008 09:03 PM
Re: experiencing different behaviour for va_list initialization with NULL on PA-RISC and IA64
> Could anybody explain. [...]
Assuming that that's a question-mark-free
question, it might be easier if you provided
some actual code instead of a vague
description of some code. An actual test
program which exhibits the problem (or not)
would be even better. A complete
build-and-run transcript might save some
time and effort.
As an added bonus, you might describe your
environment more fully, including such data
as your OS and compiler versions.
> [...] Is there any document to give more
> details on this.
Details? You seem to ask for more than
you're wiling to provide.
Assuming that that's a question-mark-free
question, it might be easier if you provided
some actual code instead of a vague
description of some code. An actual test
program which exhibits the problem (or not)
would be even better. A complete
build-and-run transcript might save some
time and effort.
As an added bonus, you might describe your
environment more fully, including such data
as your OS and compiler versions.
> [...] Is there any document to give more
> details on this.
Details? You seem to ask for more than
you're wiling to provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 09:20 PM
02-25-2008 09:20 PM
Re: experiencing different behaviour for va_list initialization with NULL on PA-RISC and IA64
That's correct. A va_list is a thingy and Standard says this is an opaque type and you can't do much with it. Not even compare.
All you can do is assign/initialize to the same type. And pass to va_start, va_arg and va_end. And in C99, va_copy.
If you want to assign to a variable, you can use a hammer:
reinterpret_cast(ap) = NULL;
If you want to handle parms you must declare a static variable:
#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
{}
This is all non-Standard and you will have problems testing for that "NULL" too. (You can use the above hammer there too.)
On PA, the va_list thingy just happened to be a double*.
All you can do is assign/initialize to the same type. And pass to va_start, va_arg and va_end. And in C99, va_copy.
If you want to assign to a variable, you can use a hammer:
reinterpret_cast
If you want to handle parms you must declare a static variable:
#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
{}
This is all non-Standard and you will have problems testing for that "NULL" too. (You can use the above hammer there too.)
On PA, the va_list thingy just happened to be a double*.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2008 08:09 PM
02-26-2008 08:09 PM
Re: experiencing different behaviour for va_list initialization with NULL on PA-RISC and IA64
Thanks for the information. Now got clear
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP