forked from blender/blender
main sync #3
@ -1607,6 +1607,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|||||||
# warning level:
|
# warning level:
|
||||||
"/W3"
|
"/W3"
|
||||||
"/w34062" # switch statement contains 'default' but no 'case' labels
|
"/w34062" # switch statement contains 'default' but no 'case' labels
|
||||||
|
"/w34100" # 'identifier' : unreferenced formal parameter
|
||||||
"/w34115" # 'type' : named type definition in parentheses
|
"/w34115" # 'type' : named type definition in parentheses
|
||||||
"/w34189" # local variable is initialized but not referenced
|
"/w34189" # local variable is initialized but not referenced
|
||||||
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
|
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
|
||||||
|
@ -702,6 +702,7 @@ macro(remove_strict_flags)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||||
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
|
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -721,7 +722,7 @@ macro(remove_extra_strict_flags)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# TODO
|
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# define UNUSED(x) UNUSED_##x __attribute__((__unused__))
|
# define UNUSED(x) UNUSED_##x __attribute__((__unused__))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
/* NOTE: This suppresses the warning for the line, not the attribute. */
|
||||||
|
# define UNUSED(x) UNUSED_##x __pragma(warning(suppress : 4100))
|
||||||
#else
|
#else
|
||||||
# define UNUSED(x) UNUSED_##x
|
# define UNUSED(x) UNUSED_##x
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,6 +15,13 @@ if(WIN32)
|
|||||||
add_definitions(-D_USE_MATH_DEFINES)
|
add_definitions(-D_USE_MATH_DEFINES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# Some files in extern are being included which brings up a bunch of
|
||||||
|
# "unreferenced formal parameter" warnings.
|
||||||
|
# So restore warn C4100 (unreferenced formal parameter) back to w4
|
||||||
|
remove_cc_flag(/w34100)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(INC
|
set(INC
|
||||||
extern
|
extern
|
||||||
|
@ -668,6 +668,9 @@ extern bool BLI_memory_is_zero(const void *arr, size_t arr_size);
|
|||||||
/* UNUSED macro, for function argument */
|
/* UNUSED macro, for function argument */
|
||||||
# if defined(__GNUC__) || defined(__clang__)
|
# if defined(__GNUC__) || defined(__clang__)
|
||||||
# define UNUSED(x) UNUSED_##x __attribute__((__unused__))
|
# define UNUSED(x) UNUSED_##x __attribute__((__unused__))
|
||||||
|
# elif defined(_MSC_VER)
|
||||||
|
/* NOTE: This suppresses the warning for the line, not the attribute. */
|
||||||
|
# define UNUSED(x) UNUSED_##x __pragma(warning(suppress : 4100))
|
||||||
# else
|
# else
|
||||||
# define UNUSED(x) UNUSED_##x
|
# define UNUSED(x) UNUSED_##x
|
||||||
# endif
|
# endif
|
||||||
|
@ -35,6 +35,13 @@ if(USD_IMAGING_HEADERS)
|
|||||||
add_definitions(-DUSD_HAS_IMAGING)
|
add_definitions(-DUSD_HAS_IMAGING)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# Some USD library headers trigger the "unreferenced formal parameter"
|
||||||
|
# warning alert.
|
||||||
|
# Silence them by restore warn C4100 back to w4
|
||||||
|
remove_cc_flag(/w34100)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(INC
|
set(INC
|
||||||
.
|
.
|
||||||
../common
|
../common
|
||||||
|
@ -140,6 +140,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
|||||||
endif()
|
endif()
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
string(APPEND GENSRC_CFLAGS " -Wno-missing-variable-declarations")
|
string(APPEND GENSRC_CFLAGS " -Wno-missing-variable-declarations")
|
||||||
|
elseif(MSVC)
|
||||||
|
# Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||||
|
remove_cc_flag(/w34100)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GENSRC_CFLAGS)
|
if(GENSRC_CFLAGS)
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
# pragma GCC diagnostic error "-Wmissing-prototypes"
|
# pragma GCC diagnostic error "-Wmissing-prototypes"
|
||||||
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
/* Suppress unreferenced formal parameter warning. */
|
||||||
|
# pragma warning(disable : 4100)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* python, will come back */
|
/* python, will come back */
|
||||||
|
Loading…
Reference in New Issue
Block a user