Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Nov 1995 10:12:41 +0100 (MET)
From:      grog@lemis.de (Greg Lehey)
To:        joerg_wunsch@uriah.heep.sax.de
Cc:        hackers@freebsd.org (FreeBSD Hackers)
Subject:   Re: RPC oddities
Message-ID:  <199511060912.KAA02745@allegro.lemis.de>
In-Reply-To: <199511051709.SAA00830@uriah.heep.sax.de> from "J Wunsch" at Nov 5, 95 06:09:00 pm

next in thread | previous in thread | raw e-mail | index | archive | help
J Wunsch writes:
> 
> As Greg Lehey wrote:
> > 
> > > <rpc/rpc.h> includes definitions for several constants that are inside
> > > enum's.  To the contrary, <nfs/rpcv2.h> #define's just the very same
> > > constants.  The result is that the compiler sees something like:
> 
> > How about a series of:
> > 
> > /* Authentication failures */
> > #undef	AUTH_BADCRED	1
> > #undef	AUTH_REJECTCRED	2
> > #undef	AUTH_BADVERF	3
> > #undef	AUTH_REJECTVERF	4
> > #undef	AUTH_TOOWEAK	5		/* Give em wheaties */
> 
> Yikes!  That's exactly what i'm doing now.  But this is a first class
> mess.  Leave alone the poor appearance of the source code, but it does
> also make me nervous that the enum's and the #define's sometimes even
> disagree in their values!

That was my second suggestion:

#ifdef AUTH_BADCRED
# if AUTH_BADCRED != 1
#  error incorrect redefinition of AUTH_BADCRED
#endif
#undef AUTH_BADCRED
#endif

etc.

> Somethin's stinkin' badly here!

Well, it's not good, but it happens all over the place.  Remember that
enums are very recent in terms of acceptance (and the fact that they
have global scope just makes things worse).  The real problem is that
the way system header files are made is in itself a complete mess.

> (I was in hope for the NFS wizards to shed some light on this.)

I'd be interested to see any good replies.  I don't think that this is
an NFS problem.

Greg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511060912.KAA02745>