implicit declaration warnings

Pekka Savola pekkas at netcore.fi
Wed Dec 27 22:24:23 EST 2000


Hi,

When I tested the latest snapshot on FreeBSD 4.2, I noticed some implicit
declaration warnings I didn't recall seeing on Linux.

I think this is caused by the fact that if autoconf does detect the
presence of some BSD capability, necessary header files and declarations
may not be included (as these are assumed to be the same ~everywhere, and
already included).  If such capability is missing, everything will seem to
be fine.

E.g.:
---
uuencode.c: In function `uuencode':
uuencode.c:36: warning: implicit declaration of function `__b64_ntop'
uuencode.c: In function `uudecode':
uuencode.c:54: warning: implicit declaration of function `__b64_pton'
auth-rhosts.c: In function `check_rhosts_file':
auth-rhosts.c:110: warning: implicit declaration of function `innetgr'
loginrec.c: In function `syslogin_perform_login':
loginrec.c:1282: warning: implicit declaration of function `login'
loginrec.c: In function `syslogin_perform_logout':
loginrec.c:1295: warning: implicit declaration of function `logout'
loginrec.c:1299: warning: implicit declaration of function `logwtmp'
---

In config.h, there are:
#define HAVE___B64_NTOP 1
#define HAVE_LIBUTIL_LOGIN 1
#define HAVE_INNETGR 1

Attached patch removes the warnings about login functions BUT will break
on systems that define LIBUTIL_LOGIN but don't have libutil.h (e.g.
Linux).  So, it's not the way to go.  But some sort of "nice" way of
handling the necessary includes should probably be used?

-- 
Pekka Savola                    "Tell me of difficulties surmounted,
Netcore Oy                      not those you stumble over and fall"
Systems. Networks. Security.     -- Robert Jordan: A Crown of Swords
-------------- next part --------------
--- loginrec.c.orig	Fri Dec  1 23:19:51 2000
+++ loginrec.c	Wed Dec 27 13:06:12 2000
@@ -167,6 +167,10 @@
 #  include <util.h>
 #endif
 
+#ifdef HAVE_LIBUTIL_LOGIN
+#  include <libutil.h>
+#endif
+
 /**
  ** prototypes for helper functions in this file
  **/


More information about the openssh-unix-dev mailing list