[openssl-dev] [openssl.org #4488] PATCH: fix Windows "The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name..."

noloader@gmail.com via RT rt at openssl.org
Mon Mar 28 09:04:51 UTC 2016


This patch can be tightened further, if interested.

According to MS docs, the define _CRT_NONSTDC_NO_DEPRECATE is
available for Visual Studio 2005 (cl.exe=14.00). Also see
http://msdn.microsoft.com/en-us/library/ms235384(v=vs.80).aspx.

Testing on Visual Studio 2003 (cl.exe=13.10) shows the change is OK
there, too. We can pick up Visual Studio 2003 and its compiler through
_MSC_VER and 1310. It should leave other versions alone (CE System
Builder comes to mind).

$ git diff e_os.h > e_os.patch
$ cat e_os.patch
diff --git a/e_os.h b/e_os.h
index f0a441e..1fe3ffb 100644
--- a/e_os.h
+++ b/e_os.h
@@ -520,6 +520,13 @@ struct servent *PASCAL getservbyname(const char
*, const char *);
 # if defined(OPENSSL_SYS_WINDOWS)
 #  define strcasecmp _stricmp
 #  define strncasecmp _strnicmp
+#  if (_MSC_VER >= 1310)
+#   define open _open
+#   define fdopen _fdopen
+#   define close _close
+#   define strdup _strdup
+#   define unlink _unlink
+#  endif
 # elif defined(OPENSSL_SYS_VMS)
 /* VMS below version 7.0 doesn't have strcasecmp() */
 #  include "internal/o_str.h"

On Mon, Mar 28, 2016 at 2:59 AM, noloader at gmail.com via RT
<rt at openssl.org> wrote:
> Working from master at c5c7700c9a1c1daa.
>
> The patch below fixes multiple "The POSIX name for this item is
> deprecated. Instead, use the ISO C++ conformant name..." warnings on
> Windows. There are about 20 of them, and an example is below.
>
> diff --git a/e_os.h b/e_os.h
> index f0a441e..c9765c2 100644
> --- a/e_os.h
> +++ b/e_os.h
> @@ -520,6 +520,11 @@ struct servent *PASCAL getservbyname(const char
> *, const char *);
>  # if defined(OPENSSL_SYS_WINDOWS)
>  #  define strcasecmp _stricmp
>  #  define strncasecmp _strnicmp
> +#  define open _open
> +#  define fdopen _fdopen
> +#  define close _close
> +#  define strdup _strdup
> +#  define unlink _unlink
>  # elif defined(OPENSSL_SYS_VMS)
>  /* VMS below version 7.0 doesn't have strcasecmp() */
>  #  include "internal/o_str.h"
>
> **********
>
>         cl -DDSO_WIN32 -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_P
> IC -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENS
> SL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES
> _ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM "
> -DENGINESDIR=\"%ProgramFiles(x86)%\\OpenSSL\\lib\\engines\"" "-DOPENSSLDIR=\"%Co
> mmonProgramFiles(x86)%\\SSL\"" -W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WI
> N32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DUNICODE -D_UNI
> CODE /MT /Ox /O2 /Ob2 /Zi /Fdapp /I ..\..\Jeffrey /I apps\Walton\openssl\include
>  /I . /I include -c /Foapps\apps.obj apps\apps.c
> apps.c
> apps\apps.c(2572) : warning C4996: 'open': The POSIX name for this item is depre
> cated. Instead, use the ISO C++ conformant name: _open. See online help for deta
> ils.
>         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\io.h(315)
>  : see declaration of 'open'
> apps\apps.c(2575) : warning C4996: 'fdopen': The POSIX name for this item is dep
> recated. Instead, use the ISO C++ conformant name: _fdopen. See online help for
> details.
>         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\stdio.h(7
> 09) : see declaration of 'fdopen'
> apps\apps.c(2593) : warning C4996: 'close': The POSIX name for this item is depr
> ecated. Instead, use the ISO C++ conformant name: _close. See online help for de
> tails.
>         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\io.h(305)
>  : see declaration of 'close'
>
> --
> Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4488
> Please log in as guest with password guest if prompted
>
>
> --
> openssl-dev mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
>

-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4488
Please log in as guest with password guest if prompted

-------------- next part --------------
A non-text attachment was scrubbed...
Name: e_os.patch
Type: text/x-diff
Size: 555 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160328/2fef9732/attachment.patch>


More information about the openssl-dev mailing list