[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2094.0. "help on "invalid declaration" error messages" by FRUST::LUKAS (Unix starts with an `L') Tue Feb 18 1997 09:11

Hello,

I have tried to compile a file from the UCX/eSNMP example MIB and I have
got many identical error messages.

I have used the following compiler command (OpenVMS 7.1/UCX 4.1):

	$ CC chess-mib.c 

... and thats the output from the compiler:

	     40 
	     41 /*********************************************************************
	     42 |                                                                    
	     43 |  chess-mib.c    Example Extensible SNMP Subagent 
	     44 |
	     45 |  This example sub-agent implements the wholly-fictitious
	     46 |  chess MIB.
	     47 |
	     48 |
	     49 *********************************************************************/
	     50 
	     51 #include <stdlib.h>
	   1543 #include <stdio.h>
	   2215 #include <errno.h>
	   2386 #include <string.h>
       X   2787 #include <signal.h>
	   2788 #include <sys/types.h>
	   3133 #include <sys/time.h>

                                Source Listing                  18-FEB-1997 15:04:16  DEC C V5.5-002                    Page 2      
                                                                24-JUL-1996 12:31:20  [SYSHLP.EXAMPLES.UCX.SNMP]CHESS_MIB.C;1  

	   3710 #include <netinet/in.h>
	   4097 
	   4098 #include "esnmp.h"			  /* esnmp definitions */
	   5137 int     esnmp_init __((int *ssocket, char *subagent_identifier));
		...................1                                              
%CC-E-DECLARATION, (1) Invalid declaration.

	   5138 int     esnmp_are_you_there __((void));
		............................1           
%CC-E-DECLARATION, (1) Invalid declaration.

	   5139 int     esnmp_register __((SUBTREE *subtree, int timeout, int priority));
		.......................1                                                  
%CC-E-DECLARATION, (1) Invalid declaration.

	   5140 int     esnmp_unregister __((SUBTREE *subtree));
		.........................1                       
%CC-E-DECLARATION, (1) Invalid declaration.
.
.
.
... and so on ...

Why is it an invalid declaration. On Digital UNIX does it compile without
any problems.

Could somebody help me ?


regards,

Dieter Lukas
T.RTitleUserPersonal
Name
DateLines
2094.1WIBBIN::NOYCEPulling weeds, pickin&#039; stonesTue Feb 18 1997 09:413
You need to find out who is supposed to declare the "__" macro,
and why it's not working properly -- perhaps it's incorrectly
conditionalized for DEC C / VMS.
2094.2"proto" macro in /usr/include/standards.hDECC::SULLIVANJeff SullivanTue Feb 18 1997 11:3920
On Digital UNIX, the macro expands to a full prototype or a K&R style prototype
depending on the compiler mode. Here's how it's defined:

#if !defined(__STDC__) && !defined(__cplusplus)
#ifndef _NO_PROTO
#define _NO_PROTO
#endif

#ifdef _NO_PROTO
#define __(__args__)    ()
#else /* _NO_PROTO */
#define __(__args__)    __args__
#endif /* _NO_PROTO */

You would get this implicitly by including many of the standard headers (stdio,
stdlib, etc...).

Not sure why it's not defined, in your case, on VMS.

-Jeff
2094.3/STANDARD=VAXC is the solutionFRUST::LUKASUnix starts with an `L&#039;Fri Mar 07 1997 03:3011
    
    Hello,
    
    I found out that I have to use the /STANDARD=VAXC switch to eliminate these
    warning messages.
    
    
    regards,
    
    Dieter