- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- warning #2140-D: too many arguments in function ca...
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
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
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
07-28-2008 03:10 AM
07-28-2008 03:10 AM
warning #2140-D: too many arguments in function call with va_alist
Could anybody help on the below issue. I am facing this error on HP Itanium with bot cc and aCC
err_sys.h:
==========
#include
#include
int err_sys(va_alist)
va_dcl
{
char *frmt,*varg1;
va_list ap;
va_start(ap);
frmt=va_arg(ap,char *);
varg1=va_arg(ap,char *);
printf("Variable Args are: %s\n", varg1);
va_end(ap);
return 0;
}
varlist.c:
===========
#include "err_sys.h"
int err_sys();
int main()
{
err_sys("%s: signal %d, sts = %d, prev = %d", "India, 123, 456, 789");
return 0;
}
compilation line:
=================
cc +DD64 -o result +M2 -DCMMSG_RV -DUNIX -D_HPUX_SOURCE -D_REENTRANT -D_PTHREADS_DRAFT4 varlist.c
"varlist.c", line 6: warning #2140-D: too many arguments in function call
err_sys("%s: signal %d, sts = %d, prev = %d", "India, 123, 456, 789");
- Tags:
- va_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2008 04:05 AM - edited 09-11-2011 06:19 AM
07-28-2008 04:05 AM - edited 09-11-2011 06:19 AM
Re: warning #2140-D: too many arguments in function call with va_alist
K&R is NOT supported on IPF. You must port your code to use:
#include <stdarg.h>
...
int err_sys(const char *frmt, ...) {
const char *varg1;
va_list ap;
va_start(ap, frmt);
varg1=va_arg(ap, const char*);
Replace +M2 by +w64bit.
-D_PTHREADS_DRAFT4 is NOT available on IPF. You should be using kernel threads, even on PA.
If you want to use libpthread, you should compile with -mt.