[openssl-dev] [openssl.org #4458] "implicitly declared function" warnings due to missing <strings.h> include

Viktor Dukhovni openssl-users at dukhovni.org
Thu May 26 01:39:33 UTC 2016


On Wed, May 25, 2016 at 09:46:02PM +0000, Richard Levitte via RT wrote:

> I don't get such warnings. Can you tell me what system and with what tool chain
> (including versions)?

I think that the report is correct, we must be getting away with <string.h>
on most platforms.  On NetBSD, for example, <string.h> includes <strings.h>
when _NETBSD_SOURCE is defined true, which requires:

    #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
	!defined(_XOPEN_SOURCE) && !defined(_NETBSD_SOURCE)
    #define _NETBSD_SOURCE 1
    #endif

So generally you get the extended features, but not always.  The
fix might be:

diff --git a/e_os.h b/e_os.h
index 1c4c204..4b3e6fd 100644
--- a/e_os.h
+++ b/e_os.h
@@ -475,6 +475,8 @@ struct servent *PASCAL getservbyname(const char *, const char *);
 #  define strcasecmp OPENSSL_strcasecmp
 #  define strncasecmp OPENSSL_strncasecmp
 #  define OPENSSL_IMPLEMENTS_strncasecmp
+# else
+#  include <strings.h>
 # endif
 
 /* vxworks */

-- 
	Viktor.


More information about the openssl-dev mailing list