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:
parent
6ef8264fcc
commit
da6439685d
@ -28,9 +28,11 @@ if (ENABLE_TESTS OR ENABLE_WEBMTS)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/build/cxx11_tests.cmake")
|
||||
endif ()
|
||||
|
||||
# Turn up the warning levels.
|
||||
# Set warning levels.
|
||||
if (MSVC)
|
||||
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 ()
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}" CACHE
|
||||
|
@ -23,11 +23,6 @@
|
||||
#include "mkvmuxer/mkvwriter.h"
|
||||
#include "mkvparser/mkvparser.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Disable MSVC warnings that suggest making code non-portable.
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
namespace mkvmuxer {
|
||||
|
||||
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
|
||||
|
@ -24,11 +24,6 @@
|
||||
#include "mkvmuxer/mkvmuxer.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 {
|
||||
|
@ -22,11 +22,6 @@
|
||||
|
||||
#include "common/webmids.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Disable MSVC warnings that suggest making code non-portable.
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
namespace mkvparser {
|
||||
const double MasteringMetadata::kValueNotPresent = DBL_MAX;
|
||||
const long long Colour::kValueNotPresent = LLONG_MAX;
|
||||
|
@ -16,11 +16,6 @@
|
||||
#include "mkvparser/mkvparser.h"
|
||||
#include "mkvparser/mkvreader.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Disable MSVC warnings that suggest making code non-portable.
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
const wchar_t* utf8towcs(const char* str) {
|
||||
if (str == NULL)
|
||||
|
@ -29,11 +29,6 @@
|
||||
|
||||
#include "sample_muxer_metadata.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Disable MSVC warnings that suggest making code non-portable.
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
void Usage() {
|
||||
|
@ -25,11 +25,6 @@
|
||||
#include "mkvparser/mkvreader.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::Chapter;
|
||||
using mkvmuxer::Frame;
|
||||
|
@ -7,11 +7,6 @@
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
#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 <cstdio>
|
||||
#include <cstdlib>
|
||||
|
@ -18,11 +18,6 @@
|
||||
#include "mkvparser/mkvreader.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;
|
||||
|
||||
namespace libwebm {
|
||||
|
@ -8,11 +8,6 @@
|
||||
|
||||
#include "./vttreader.h" // NOLINT
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Disable MSVC warnings that suggest making code non-portable.
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
namespace libwebvtt {
|
||||
|
||||
VttReader::VttReader() : file_(NULL) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user