mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[BE] Build PyTorch with -Wnewline-eof (#99687)
This would avoid further regressions like the ones reported in https://github.com/pytorch/pytorch/pull/96668#issuecomment-1468029259 Surround some ONNX/flatbuffer includes with `C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wnewline-eof")` cone of shame Fixes https://github.com/pytorch/pytorch/issues/96747 Pull Request resolved: https://github.com/pytorch/pytorch/pull/99687 Approved by: https://github.com/kit1980
This commit is contained in:
parent
dbf0db958f
commit
6b8ef8ea4c
|
|
@ -809,6 +809,7 @@ if(NOT MSVC)
|
|||
append_cxx_flag_if_supported("-Wno-strict-overflow" CMAKE_CXX_FLAGS)
|
||||
append_cxx_flag_if_supported("-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
|
||||
append_cxx_flag_if_supported("-Wvla-extension" CMAKE_CXX_FLAGS)
|
||||
append_cxx_flag_if_supported("-Wnewline-eof" CMAKE_CXX_FLAGS)
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-range-loop-analysis")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-pass-failed")
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
#include <c10/macros/Macros.h>
|
||||
|
||||
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wsuggest-override")
|
||||
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wnewline-eof")
|
||||
#include <onnx/shape_inference/implementation.h>
|
||||
C10_DIAGNOSTIC_POP()
|
||||
C10_DIAGNOSTIC_POP()
|
||||
|
||||
#include <torch/csrc/jit/ir/ir.h>
|
||||
#include <torch/csrc/jit/serialization/export.h>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@
|
|||
#include <torch/version.h>
|
||||
#include <atomic>
|
||||
|
||||
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wnewline-eof")
|
||||
#include <onnx/checker.h>
|
||||
C10_DIAGNOSTIC_POP()
|
||||
#include <onnx/onnx_pb.h>
|
||||
#include <onnx/proto_utils.h>
|
||||
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wsuggest-override")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@
|
|||
#ifndef FLATBUFFERS_GENERATED_MOBILEBYTECODE_TORCH_JIT_MOBILE_SERIALIZATION_H_
|
||||
#define FLATBUFFERS_GENERATED_MOBILEBYTECODE_TORCH_JIT_MOBILE_SERIALIZATION_H_
|
||||
|
||||
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wnewline-eof")
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
C10_DIAGNOSTIC_POP()
|
||||
|
||||
namespace torch {
|
||||
namespace jit {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user