Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Mar 1997 11:50:21 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, imp@village.org
Cc:        current@FreeBSD.org, helbig@MX.BA-Stuttgart.De
Subject:   Re: make world fails on libmytinfo
Message-ID:  <199703270050.LAA00483@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>: >  /* for quit.c */
>: >  extern int sys_nerr;
>: >! #if __FreeBSD__ != 2 && __FreeBSD__ != 3
>: >  extern char *sys_errlist[];
>: >  #endif
>: >  extern char *prg_name;
>: 
>: It is just harmful.  Const'ness of sys_errlist has nothing to do with
>: FreeBSD.
>: 
>: BTW, sys_nerr is also const in FreeBSD, but the type mismatch is only
>: warned about if gcc is invoked with -pedantic.
>
>And it is even esier to fix.  Most modern systems have errno.h.  Just
>include that.  Since it is in our CVS tree, that seems will be
>acceptible.

errno.h is the problem, not the solution.  It pollutes the application
namespace by declaring sys_nerr and sys_errlist.  libmytinfo is chummy
with the implementation in using (*) these variables instead of the public
interface (strerror()), but not chummy enough to get the declarations
right (except using an ifdef hack).

(*) libmytinfo doesn't actually use these variables.  It just miscdeclares
them.  It claims to use them ``/* for quit.c */'', but quit.c isn't in
FreeBSD.

Bruce



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