Nicolas Williams wrote:
>> Actually, there's one variant that would rely only on arguably documented 
>> features:  if you use -L and interpose on syslog.  Interposing on libc 
>> functions just makes me queasy.
> 
> But I thought it was clear that using a CPP macro to rename that symbol
> was the way to go.

I thought so, but became less happy with that when I realized that % lines 
were duplicated in all of the generated code, not just in the *_svc.c file. 
  Including a #define syslog in the generated *.h file would be bad.  You 
can work around this by putting the % lines inside #if defined(RPC_SVC), 
but that's starting to get kind of ugly.  You might think that you could 
-Dsyslog=mylog when you compile *_svc.c, but then you don't have an extern 
declaration for mylog.

>> All of the other variations involve macros and those make assumptions about 
>> the structure of the generated file.
> 
> I don't agree.  The XDR input to rpcgen is definitely stable, if not
> even Committed Standard at least in part (since it is documented in a
> standards-track RFC).

Er... I said the *generated* file, the output, not the input.

Agreed, the RPCL input is stable.  What is far from stable is the generated 
C code, which is where the message references are.

Note that one thing about the RPCL is documented as unstable - where % 
lines appear in the output:
     http://docs.sun.com/app/docs/doc/802-1997/6i6091lam?a=view
         rpcgen provides an additional preprocessing feature: any line that
         begins with a percent sign (%) is passed directly to the output
         file, with no action on the line's content. Caution is required
         because rpcgen does not always place the lines where you intend.
         Check the output source file and, if needed, edit it.

Reply via email to