[C++] Fix clang -Wnewline-eof warning (#7711)

* Fix clang -Wnewline-eof warning

* Enable -Wnewline-eof warning

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
mogemimi 2022-12-15 14:35:54 +09:00 committed by GitHub
parent 52d1b77941
commit 9927747d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 17 additions and 16 deletions

View File

@ -426,6 +426,7 @@ else()
# This isn't working for some reason: $<$<CXX_COMPILER_ID:CLANG>:
$<$<BOOL:${IS_CLANG}>:
-Wnewline-eof
-Wno-unknown-warning-option
-Wmissing-declarations
-Wzero-as-null-pointer-constant

View File

@ -65,4 +65,4 @@ class Allocator {
} // namespace flatbuffers
#endif // FLATBUFFERS_ALLOCATOR_H_
#endif // FLATBUFFERS_ALLOCATOR_H_

View File

@ -50,4 +50,4 @@ template<typename T> struct BufferRef : BufferRefBase {
} // namespace flatbuffers
#endif // FLATBUFFERS_BUFFER_REF_H_
#endif // FLATBUFFERS_BUFFER_REF_H_

View File

@ -61,4 +61,4 @@ inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p,
} // namespace flatbuffers
#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_
#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_

View File

@ -61,4 +61,4 @@ static inline flatbuffers::string_view GetStringView(const String *str) {
} // namespace flatbuffers
#endif // FLATBUFFERS_STRING_H_
#endif // FLATBUFFERS_STRING_H_

View File

@ -50,4 +50,4 @@ class Struct FLATBUFFERS_FINAL_CLASS {
} // namespace flatbuffers
#endif // FLATBUFFERS_STRUCT_H_
#endif // FLATBUFFERS_STRUCT_H_

View File

@ -630,4 +630,4 @@ std::unique_ptr<BfbsGenerator> NewLuaBfbsGenerator(
return std::unique_ptr<LuaBfbsGenerator>(new LuaBfbsGenerator(flatc_version));
}
} // namespace flatbuffers
} // namespace flatbuffers

View File

@ -30,4 +30,4 @@ std::unique_ptr<BfbsGenerator> NewLuaBfbsGenerator(
} // namespace flatbuffers
#endif // FLATBUFFERS_BFBS_GEN_LUA_H_
#endif // FLATBUFFERS_BFBS_GEN_LUA_H_

View File

@ -48,4 +48,4 @@ class BfbsNamer : public Namer {
} // namespace flatbuffers
#endif // FLATBUFFERS_BFBS_NAMER
#endif // FLATBUFFERS_BFBS_NAMER

View File

@ -389,4 +389,4 @@ class BinaryAnnotator {
} // namespace flatbuffers
#endif // FLATBUFFERS_BINARY_ANNOTATOR_H_
#endif // FLATBUFFERS_BINARY_ANNOTATOR_H_

View File

@ -13,4 +13,4 @@ void ParseFlexbuffersFromJsonWithNullTest();
} // namespace tests
} // namespace flatbuffers
#endif // TESTS_FLEXBUFFERS_TEST_H
#endif // TESTS_FLEXBUFFERS_TEST_H

View File

@ -171,4 +171,4 @@ void JsonUnsortedArrayTest() {
}
} // namespace tests
} // namespace flatbuffers
} // namespace flatbuffers

View File

@ -15,4 +15,4 @@ void JsonUnsortedArrayTest();
} // namespace tests
} // namespace flatbuffers
#endif
#endif

View File

@ -35,4 +35,4 @@ void UnPackTo(const uint8_t *flatbuf);
} // namespace tests
} // namespace flatbuffers
#endif
#endif

View File

@ -98,4 +98,4 @@ void OptionalScalarsTest() {
}
}
}
}

View File

@ -30,4 +30,4 @@ void FieldIdentifierTest();
} // namespace tests
} // namespace flatbuffers
#endif // TESTS_PARSER_TEST_H
#endif // TESTS_PARSER_TEST_H

View File

@ -15,4 +15,4 @@ void ParseProtoBufAsciiTest();
} // namespace tests
} // namespace flatbuffers
#endif
#endif