Skip to content

Commit

Permalink
[C++] Fix clang -Wnewline-eof warning (google#7711)
Browse files Browse the repository at this point in the history
* Fix clang -Wnewline-eof warning

* Enable -Wnewline-eof warning

Co-authored-by: Derek Bailey <[email protected]>
  • Loading branch information
mogemimi and dbaileychess authored Dec 15, 2022
1 parent 52d1b77 commit 9927747
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/flatbuffers/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ class Allocator {

} // namespace flatbuffers

#endif // FLATBUFFERS_ALLOCATOR_H_
#endif // FLATBUFFERS_ALLOCATOR_H_
2 changes: 1 addition & 1 deletion include/flatbuffers/buffer_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ template<typename T> struct BufferRef : BufferRefBase {

} // namespace flatbuffers

#endif // FLATBUFFERS_BUFFER_REF_H_
#endif // FLATBUFFERS_BUFFER_REF_H_
2 changes: 1 addition & 1 deletion include/flatbuffers/default_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
2 changes: 1 addition & 1 deletion include/flatbuffers/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ static inline flatbuffers::string_view GetStringView(const String *str) {

} // namespace flatbuffers

#endif // FLATBUFFERS_STRING_H_
#endif // FLATBUFFERS_STRING_H_
2 changes: 1 addition & 1 deletion include/flatbuffers/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ class Struct FLATBUFFERS_FINAL_CLASS {

} // namespace flatbuffers

#endif // FLATBUFFERS_STRUCT_H_
#endif // FLATBUFFERS_STRUCT_H_
2 changes: 1 addition & 1 deletion src/bfbs_gen_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,4 +630,4 @@ std::unique_ptr<BfbsGenerator> NewLuaBfbsGenerator(
return std::unique_ptr<LuaBfbsGenerator>(new LuaBfbsGenerator(flatc_version));
}

} // namespace flatbuffers
} // namespace flatbuffers
2 changes: 1 addition & 1 deletion src/bfbs_gen_lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ std::unique_ptr<BfbsGenerator> NewLuaBfbsGenerator(

} // namespace flatbuffers

#endif // FLATBUFFERS_BFBS_GEN_LUA_H_
#endif // FLATBUFFERS_BFBS_GEN_LUA_H_
2 changes: 1 addition & 1 deletion src/bfbs_namer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ class BfbsNamer : public Namer {

} // namespace flatbuffers

#endif // FLATBUFFERS_BFBS_NAMER
#endif // FLATBUFFERS_BFBS_NAMER
2 changes: 1 addition & 1 deletion src/binary_annotator.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,4 @@ class BinaryAnnotator {

} // namespace flatbuffers

#endif // FLATBUFFERS_BINARY_ANNOTATOR_H_
#endif // FLATBUFFERS_BINARY_ANNOTATOR_H_
2 changes: 1 addition & 1 deletion tests/flexbuffers_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ void ParseFlexbuffersFromJsonWithNullTest();
} // namespace tests
} // namespace flatbuffers

#endif // TESTS_FLEXBUFFERS_TEST_H
#endif // TESTS_FLEXBUFFERS_TEST_H
2 changes: 1 addition & 1 deletion tests/json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ void JsonUnsortedArrayTest() {
}

} // namespace tests
} // namespace flatbuffers
} // namespace flatbuffers
2 changes: 1 addition & 1 deletion tests/json_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ void JsonUnsortedArrayTest();
} // namespace tests
} // namespace flatbuffers

#endif
#endif
2 changes: 1 addition & 1 deletion tests/monster_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ void UnPackTo(const uint8_t *flatbuf);
} // namespace tests
} // namespace flatbuffers

#endif
#endif
2 changes: 1 addition & 1 deletion tests/optional_scalars_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ void OptionalScalarsTest() {
}

}
}
}
2 changes: 1 addition & 1 deletion tests/parser_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ void FieldIdentifierTest();
} // namespace tests
} // namespace flatbuffers

#endif // TESTS_PARSER_TEST_H
#endif // TESTS_PARSER_TEST_H
2 changes: 1 addition & 1 deletion tests/proto_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ void ParseProtoBufAsciiTest();
} // namespace tests
} // namespace flatbuffers

#endif
#endif

0 comments on commit 9927747

Please sign in to comment.