[comp.sys.hp] Problem with rpcgen on HP-UX

paul@mecazh.UUCP (Paul Breslaw) (07/04/89)

I am using rpcgen on an HP 9000/340 under HP-UX 6.5 and have hit a problem
with the way rpcgen translates RPC typedefs into C.

I have run the same file through rpcgen on a Sun 3/50 (SunOS 3.5) and 
got different results.

Here are the details.

This is the RPC source file.

/* foo.x - RPC example */

typedef double REAL;
typedef char   NAME[ 32 ];
typedef int    INTEGER;

program FOOPROG {
    version FOOVERS {
        void foo_p1( REAL ) = 1;
        void foo_p2( NAME ) = 2;
        void foo_p3( INTEGER ) = 3;
    } = 1;
} = 99;




On HP-UX after running it through rpcgen, I get the following .h file


typedef double *REAL;           <---------- NOTE
bool_t xdr_REAL();


typedef char NAME[32];          <---------- NOTE
bool_t xdr_NAME();


typedef int *INTEGER;           <---------- NOTE
bool_t xdr_INTEGER();


#define FOOPROG ((u_long)99)
#define FOOVERS ((u_long)1)
#define foo_p1 ((u_long)1)
extern void *foo_p1_1();
#define foo_p2 ((u_long)2)
extern void *foo_p2_1();
#define foo_p3 ((u_long)3)
extern void *foo_p3_1();


While on the Sun, this is the header file


typedef double REAL;           <---------- NOTE DIFFERENT


typedef char NAME[32];         <---------- NOTE SAME


typedef int INTEGER;           <---------- NOTE DIFFERENT


#define FOOPROG 99
#define FOOVERS 1
#define foo_p1 1
#define foo_p2 2
#define foo_p3 3

bool_t xdr_REAL();
bool_t xdr_NAME();
bool_t xdr_INTEGER();


The corresponding xdr .c files generated by rpcgen are identical.

What is going on here ???


Paul Breslaw
Mecasoft SA
Zurich
Switzerland         ..mcvax!cernvax!mecazh!paul