Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6991482

Add global jdk makefile options to silence some VS2010 warnings

XMLWordPrintable

    • b124
    • generic
    • generic

      The warning from VS2010 compilers: _STATIC_CPPLIB is deprecated

      Silence this warning.

      diff --git a/make/common/Defs-windows.gmk b/make/common/Defs-windows.gmk
      --- a/make/common/Defs-windows.gmk
      +++ b/make/common/Defs-windows.gmk
      @@ -266,6 +266,8 @@
       # -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd)
       #
       # NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
      +# NOTE: We use /D _DISABLE_DEPRECATE_STATIC_CPPLIB to shut up VS2010
      +# about it being deprecated.
       #
       # If MS_RUNTIME_STATIC is requested, use -MT only with VS2003.
       ifeq ($(MS_RUNTIME_STATIC),true)
      @@ -293,7 +295,7 @@
       endif
       
       # Always add _STATIC_CPPLIB definition
      -STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
      +STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
       MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
       
       ifeq ($(CC_VERSION),msvc)
      diff --git a/make/common/Defs-windows.gmk b/make/common/Defs-windows.gmk
      --- a/make/common/Defs-windows.gmk
      +++ b/make/common/Defs-windows.gmk
      @@ -266,6 +266,8 @@
       # -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd)
       #
       # NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
      +# NOTE: We use /D _DISABLE_DEPRECATE_STATIC_CPPLIB to shut up VS2010
      +# about it being deprecated.
       #
       # If MS_RUNTIME_STATIC is requested, use -MT only with VS2003.
       ifeq ($(MS_RUNTIME_STATIC),true)
      @@ -293,7 +295,7 @@
       endif
       
       # Always add _STATIC_CPPLIB definition
      -STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
      +STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
       MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
       
       ifeq ($(CC_VERSION),msvc)
      @@ -395,8 +397,11 @@
       # Treat compiler warnings as errors, if requested
       #
       CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
      -# Turn off security warnings about using the standard C library function strcpy
      -CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
      +# The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on
      +# the standard C library functions like strcpy.
      +# The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using
      +# non-standard C POSIX functions.
      +CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
       ifeq ($(COMPILER_WARNINGS_FATAL),true)
         CFLAGS_COMMON += -WX
       endif

            ohair Kelly Ohair (Inactive)
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: