- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- #error 2020
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
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
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
тАО04-15-2009 02:58 AM
тАО04-15-2009 02:58 AM
"saverest.c", line 69: error #2020: identifier "FunctionArgList" is undefined
int ZtSave(Object, FunctionArgList)
^
"saverest.c", line 69: error #2141-D: unnamed prototyped parameters not allowed when body is present
int ZtSave(Object, FunctionArgList)
^
"saverest.c", line 70: error #2130: expected a "{"
ZtId Object;
^
and I have the following code:
int ZtSave(Object,FunctionArgList)
ZtId Object;
ZtArgList FunctionArgList;
{
Zt_FcnAttributes fcnatts;
int iscls, oldErrLevel = ZtErrLevel;
.
.
.
The problem is the declaration of ZtId Object and ZtArgList FunctionArglist, which is made after the function declaration. If I write the header like this:
int ZtSave(ZtId Object,ZtArgList FunctionArgList)
It works, and I have compiled other functions like this with the declaration after the header and it haven't return any mistake, and I don't know why, it could be because I need one more define in the Makefile?
Thanks gurus.
Solved! Go to Solution.
- Tags:
- prototype
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 07:48 AM
тАО04-15-2009 07:48 AM
SolutionWhich gcc is that? "gcc -v"? On what?
"uname -a"?
> and I have the following code:
And much more, which you haven't shared. A
small, _complete_ test case would be easier
to debug.
I find it interesting that the _first_
complaint refers to the _second_ parameter
(as if gcc thought that "Object" was a type,
but "FunctionArgList" was not).
But I can't see enough of the code to do more
than make guesses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 12:10 PM
тАО04-15-2009 12:10 PM
Re: #error 2020
Error 2020 is an aC++ error message, not gcc.
Did you use cc or aCC to compile? What does your compile line look like?
>The problem is the declaration of ZtId Object and ZtArgList FunctionArglist, which is made after the function declaration.
This is a garbage K&R style definition, you should use C++ or ANSI C style prototypes.
>I have compiled other functions like this with the declaration after
It only complained about FunctionArgList and not Object. Has FunctionArgList appeared before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 12:14 PM
тАО04-15-2009 12:14 PM
Re: #error 2020
That's probably exactly the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:02 AM
тАО04-16-2009 02:02 AM
Re: #error 2020
cc -c -O -Wp,-H256000 -DRELEASE -Dhpux -D_CLASSIC_TYPES -DX11R6 -I/hpi
vi/tape/usr/include/X11R2 -I/usr/include/X11R6 -I. -I../../inc saverest.c
and the varible FunctionArgList is a ZtArgList variable, which is the typedef of one struct in one library, I have other variables as the same kind, and I know it isn't problem of the library because the compiler undestand them.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:16 AM
тАО04-16-2009 02:16 AM
Re: #error 2020
As Steven said, the problem is with Object, it's probably a type.
As I said, you should get rid of the garbage K&R definitions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 02:33 AM
тАО04-16-2009 02:33 AM
Re: #error 2020
Sorry but I don't Know much about unix.
Thanks and escuses for my little knowledge.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 03:26 AM
тАО04-16-2009 03:26 AM
Re: #error 2020
This is a C term, nothing to do with Unix.
K&R is the initial version of C before it became an official standard.
foo(x,y) int x,y { return x + y; }
This is a garbage K&R definition.
int foo(int x, int y);
This is a C++ or ANSI C prototype.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2009 03:53 AM
тАО04-16-2009 03:53 AM
Re: #error 2020
> What's the K&R definitions?
This might help, too:
http://en.wikipedia.org/wiki/K%26R_C
http://en.wikipedia.org/wiki/C99
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-17-2009 09:00 PM
тАО04-17-2009 09:00 PM
Re: #error 2020
Steven is correct. This type of garbage K&R definition is only legal in K&R. Neither HP C, aCC6 in C mode, nor gcc like this. They see the initial type (Object) and assume it is a parameter-type-list.