Fix a couple of warnings from the linux and VC 14.11 toolset builds

This commit is contained in:
Scott McKay 2018-11-26 10:31:33 +10:00
parent 720aca581a
commit eef4db37f3

View file

@ -1,6 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// there's no way to use a raw pointer as the copy destination with std::copy_n
// (which gsl::copy uses with span::data() which returns a raw pointer) with the 14.11 toolset
// without generating a 4996 warning. going through an iterator is way too much overhead so turn off the warning.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
#include "core/providers/cpu/controlflow/scan.h"
#include "core/framework/framework_common.h"
@ -12,6 +19,10 @@
#include "core/providers/cpu/tensor/utils.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
using namespace ONNX_NAMESPACE;
using namespace onnxruntime::common;
@ -156,7 +167,6 @@ class OutputIterator {
OpKernelContextInternal& context_;
const int output_index_;
std::vector<int64_t> dims_;
TensorShapeProto per_iteration_shape_;
TensorShape final_shape_;
bool is_loop_state_var_;
@ -334,8 +344,8 @@ OutputIterator::OutputIterator(OpKernelContextInternal& context,
TensorShape final_shape)
: context_{context},
output_index_{output_index},
is_loop_state_var_{is_loop_state_var},
final_shape_{final_shape},
is_loop_state_var_{is_loop_state_var},
cur_iteration_{0} {
is_concrete_shape_ = final_shape_.Size() >= 0;