Subject: bug in rpcgen
To: None <current-users@netbsd.org>
From: Perry E. Metzger <perry@imsi.com>
List: current-users
Date: 10/13/1994 16:22:16
Hi there.

I've found a bug in rpcgen.

Sun rpcgen passes through \ characters that appear at the end of line
in % quoted regions. Thus (to use a real example), 

%#define KRDDMsgPageImageCopy(pi) \
%       (KRDDMsgPageImage *)XdrCopy((XdrFunc)xdr_KRDDMsgPageImage, \
%           sizeof(KRDDMsgPageImage), (XtPointer)pi)

turns into

#define KRDDMsgPageImageCopy(pi) \
       (KRDDMsgPageImage *)XdrCopy((XdrFunc)xdr_KRDDMsgPageImage, \
           sizeof(KRDDMsgPageImage), (XtPointer)pi)


The rpcgen in NetBSD (and in BSDI 1.1) interprets
these characters, thus turning the line into the following very wide mess:

#define KRDDMsgPageImageCopy(pi) %      (KRDDMsgPageImage *)XdrCopy((XdrFunc)xdr_KRDDMsgPageImage, %        sizeof(KRDDMsgPageImage), (XtPointer)pi)


The rpcgen in NetBSD seems to be based on the code sun released to the
net, so perhaps Sun fixed this in their version of the OS but never
bothered to to tell anyone.

BTW, Sun also now offers an rpcgen option with the rpcgen send along
with their unbundled compiler (the -C option) that generates ANSI
code.

Perry