cmake/msvc: Disable C4996 project wide.
MSVC C4996 triggers upon use of functions like fopen, and suggests use of non-portable Microsoft replacements. Disable it project wide, and remove the pragmas littered throughout the tree. Change-Id: I8b890bbfd3cd7224c25350bd28f334facd8b7783
This commit is contained in:
@@ -28,9 +28,11 @@ if (ENABLE_TESTS OR ENABLE_WEBMTS)
|
|||||||
include("${CMAKE_CURRENT_SOURCE_DIR}/build/cxx11_tests.cmake")
|
include("${CMAKE_CURRENT_SOURCE_DIR}/build/cxx11_tests.cmake")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Turn up the warning levels.
|
# Set warning levels.
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(CMAKE_CXX_FLAGS "/W4 ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS "/W4 ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
||||||
|
# Disable MSVC warnings that suggest making code non-portable.
|
||||||
|
set(CMAKE_CXX_FLAGS "/wd4996 ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
||||||
else ()
|
else ()
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}" CACHE
|
set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}" CACHE
|
||||||
|
|||||||
@@ -23,11 +23,6 @@
|
|||||||
#include "mkvmuxer/mkvwriter.h"
|
#include "mkvmuxer/mkvwriter.h"
|
||||||
#include "mkvparser/mkvparser.h"
|
#include "mkvparser/mkvparser.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mkvmuxer {
|
namespace mkvmuxer {
|
||||||
|
|
||||||
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
|
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
|
||||||
|
|||||||
@@ -24,11 +24,6 @@
|
|||||||
#include "mkvmuxer/mkvmuxer.h"
|
#include "mkvmuxer/mkvmuxer.h"
|
||||||
#include "mkvmuxer/mkvwriter.h"
|
#include "mkvmuxer/mkvwriter.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mkvmuxer {
|
namespace mkvmuxer {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|||||||
@@ -22,11 +22,6 @@
|
|||||||
|
|
||||||
#include "common/webmids.h"
|
#include "common/webmids.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mkvparser {
|
namespace mkvparser {
|
||||||
const double MasteringMetadata::kValueNotPresent = DBL_MAX;
|
const double MasteringMetadata::kValueNotPresent = DBL_MAX;
|
||||||
const long long Colour::kValueNotPresent = LLONG_MAX;
|
const long long Colour::kValueNotPresent = LLONG_MAX;
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
#include "mkvparser/mkvparser.h"
|
#include "mkvparser/mkvparser.h"
|
||||||
#include "mkvparser/mkvreader.h"
|
#include "mkvparser/mkvreader.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const wchar_t* utf8towcs(const char* str) {
|
const wchar_t* utf8towcs(const char* str) {
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
|
|||||||
@@ -29,11 +29,6 @@
|
|||||||
|
|
||||||
#include "sample_muxer_metadata.h"
|
#include "sample_muxer_metadata.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void Usage() {
|
void Usage() {
|
||||||
|
|||||||
@@ -25,11 +25,6 @@
|
|||||||
#include "mkvparser/mkvreader.h"
|
#include "mkvparser/mkvreader.h"
|
||||||
#include "testing/test_util.h"
|
#include "testing/test_util.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using mkvmuxer::AudioTrack;
|
using mkvmuxer::AudioTrack;
|
||||||
using mkvmuxer::Chapter;
|
using mkvmuxer::Chapter;
|
||||||
using mkvmuxer::Frame;
|
using mkvmuxer::Frame;
|
||||||
|
|||||||
@@ -7,11 +7,6 @@
|
|||||||
// be found in the AUTHORS file in the root of the source tree.
|
// be found in the AUTHORS file in the root of the source tree.
|
||||||
#include "testing/test_util.h"
|
#include "testing/test_util.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|||||||
@@ -18,11 +18,6 @@
|
|||||||
#include "mkvparser/mkvreader.h"
|
#include "mkvparser/mkvreader.h"
|
||||||
#include "webvtt/webvttparser.h"
|
#include "webvtt/webvttparser.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
namespace libwebm {
|
namespace libwebm {
|
||||||
|
|||||||
@@ -8,11 +8,6 @@
|
|||||||
|
|
||||||
#include "./vttreader.h" // NOLINT
|
#include "./vttreader.h" // NOLINT
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace libwebvtt {
|
namespace libwebvtt {
|
||||||
|
|
||||||
VttReader::VttReader() : file_(NULL) {}
|
VttReader::VttReader() : file_(NULL) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user