Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation warnings in release v0.3.6 #24

Open
mewmew opened this issue May 15, 2019 · 8 comments
Open

Compilation warnings in release v0.3.6 #24

mewmew opened this issue May 15, 2019 · 8 comments

Comments

@mewmew
Copy link
Contributor

mewmew commented May 15, 2019

Happy to see the latest release. It compiles and runs just fine. However, there are a few warnings reported during compilation.

With GCC 8.3.0, the following warnings are reported during build:

$ make
Scanning dependencies of target DGEngine
[ 36%] Building CXX object CMakeFiles/DGEngine.dir/src/Game/LevelMap.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:43,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:4,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:2:
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h: In instantiation of ‘FixedSizeAllocator<USER_TYPE>::FixedSizeAllocator(unsigned int) [with USER_TYPE = AStarSearch<MapSearchNode>::Node]’:
/home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:139:26:   required from ‘AStarSearch<UserState>::AStarSearch(int) [with UserState = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:16:75:   required from ‘AStarMapSearch<T>::AStarMapSearch(const LevelMap*) [with T = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:482:28:   required from here
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:87:9: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’; use assignment or value-initialization instead [-Wclass-memaccess]
   memset( m_pMemory, 0, sizeof( FSA_ELEMENT ) * m_MaxElements );
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:64:9: note: ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’ declared here
  struct FSA_ELEMENT
         ^~~~~~~~~~~
[ 51%] Building CXX object CMakeFiles/DGEngine.dir/src/Json/JsonUtils.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetObjectRaw(rapidjson::GenericValue<Encoding, Allocator>::Member*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::Member = rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2363:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndObject(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1736:18:   required from ‘rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Transit(rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Token, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1832:58:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:487:46:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Parse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2159:22:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::ParseStream(InputStream&) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2248:48:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const typename SourceEncoding::Ch*, std::size_t) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; typename SourceEncoding::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2254:43:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with unsigned int parseFlags = 0; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2258:41:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.cpp:391:45:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1952:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} with no trivial copy-assignment; use copy-assignment instead [-Wclass-memaccess]
             std::memcpy(m, members, count * sizeof(Member));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:71:8: note: ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} declared here
 struct GenericMember {
        ^~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetArrayRaw(rapidjson::GenericValue<Encoding, Allocator>*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2371:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndArray(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1766:18:   required from ‘rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Transit(rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Token, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1832:58:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:487:46:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Parse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2159:22:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::ParseStream(InputStream&) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2248:48:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const typename SourceEncoding::Ch*, std::size_t) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; typename SourceEncoding::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2254:43:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with unsigned int parseFlags = 0; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2258:41:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/src/Json/JsonUtils.cpp:391:45:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1939:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
             std::memcpy(e, values, count * sizeof(GenericValue));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:540:7: note: ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ declared here
 class GenericValue {
       ^~~~~~~~~~~~
[ 58%] Building CXX object CMakeFiles/DGEngine.dir/src/Parser/ParseFile.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetObjectRaw(rapidjson::GenericValue<Encoding, Allocator>::Member*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::Member = rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2363:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndObject(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1784:50:   required from ‘bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2414:13:   required from ‘rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, SourceAllocator>&, Allocator&) [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.cpp:164:34:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1952:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} with no trivial copy-assignment; use copy-assignment instead [-Wclass-memaccess]
             std::memcpy(m, members, count * sizeof(Member));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:71:8: note: ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} declared here
 struct GenericMember {
        ^~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetArrayRaw(rapidjson::GenericValue<Encoding, Allocator>*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2371:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndArray(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1792:49:   required from ‘bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2414:13:   required from ‘rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, SourceAllocator>&, Allocator&) [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.cpp:164:34:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1939:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
             std::memcpy(e, values, count * sizeof(GenericValue));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:540:7: note: ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ declared here
 class GenericValue {
       ^~~~~~~~~~~~
[ 64%] Building CXX object CMakeFiles/DGEngine.dir/src/Parser/ParseMenu.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetObjectRaw(rapidjson::GenericValue<Encoding, Allocator>::Member*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::Member = rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2363:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndObject(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1784:50:   required from ‘bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2414:13:   required from ‘rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, SourceAllocator>&, Allocator&) [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.cpp:240:34:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1952:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} with no trivial copy-assignment; use copy-assignment instead [-Wclass-memaccess]
             std::memcpy(m, members, count * sizeof(Member));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:71:8: note: ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} declared here
 struct GenericMember {
        ^~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.cpp:1:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetArrayRaw(rapidjson::GenericValue<Encoding, Allocator>*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2371:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndArray(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1792:49:   required from ‘bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2414:13:   required from ‘rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, SourceAllocator>&, Allocator&) [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]’
/home/u/Desktop/diablo/DGEngine/src/Parser/ParseMenu.cpp:240:34:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1939:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
             std::memcpy(e, values, count * sizeof(GenericValue));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:540:7: note: ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ declared here
 class GenericValue {
       ^~~~~~~~~~~~
[ 69%] Building CXX object CMakeFiles/DGEngine.dir/src/Parser/Parser.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/Parser.cpp:4:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetObjectRaw(rapidjson::GenericValue<Encoding, Allocator>::Member*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::Member = rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2363:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndObject(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1736:18:   required from ‘rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Transit(rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Token, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1832:58:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:487:46:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Parse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2159:22:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::ParseStream(InputStream&) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2248:48:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const typename SourceEncoding::Ch*, std::size_t) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; typename SourceEncoding::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2254:43:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with unsigned int parseFlags = 0; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2258:41:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/src/Parser/Parser.cpp:19:49:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1952:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} with no trivial copy-assignment; use copy-assignment instead [-Wclass-memaccess]
             std::memcpy(m, members, count * sizeof(Member));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/Parser.cpp:4:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:71:8: note: ‘rapidjson::GenericValue<rapidjson::UTF8<> >::Member’ {aka ‘struct rapidjson::GenericMember<rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator<> >’} declared here
 struct GenericMember {
        ^~~~~~~~~~~~~
In file included from /home/u/Desktop/diablo/DGEngine/./src/Json/JsonParser.h:5,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/ParseFile.h:3,
                 from /home/u/Desktop/diablo/DGEngine/src/Parser/Parser.cpp:4:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h: In instantiation of ‘void rapidjson::GenericValue<Encoding, Allocator>::SetArrayRaw(rapidjson::GenericValue<Encoding, Allocator>*, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::SizeType = unsigned int]’:
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2371:9:   required from ‘bool rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::EndArray(rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::SizeType = unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1766:18:   required from ‘rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Transit(rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Token, rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParsingState, InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:1832:58:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::IterativeParse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/reader.h:487:46:   required from ‘rapidjson::ParseResult rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::Parse(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2159:22:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::ParseStream(InputStream&) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2248:48:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const typename SourceEncoding::Ch*, std::size_t) [with unsigned int parseFlags = 0; SourceEncoding = rapidjson::UTF8<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; typename SourceEncoding::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2254:43:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with unsigned int parseFlags = 0; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:2258:41:   required from ‘rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>& rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Parse(const Ch*, std::size_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; StackAllocator = rapidjson::CrtAllocator; rapidjson::GenericDocument<Encoding, Allocator, StackAllocator>::Ch = char; std::size_t = long unsigned int]’
/home/u/Desktop/diablo/DGEngine/src/Parser/Parser.cpp:19:49:   required from here
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:1939:24: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
             std::memcpy(e, values, count * sizeof(GenericValue));
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/./src/rapidjson/document.h:540:7: note: ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ declared here
 class GenericValue {
       ^~~~~~~~~~~~
[ 95%] Building CXX object CMakeFiles/DGEngine.dir/src/sfeMovie/Demuxer.cpp.o
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp: In lambda function:
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:46:47: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
   std::call_once(flag1, []() {av_register_all(); });
                                               ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:27:
/usr/include/libavformat/avformat.h:2043:6: note: declared here
 void av_register_all(void);
      ^~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:46:47: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
   std::call_once(flag1, []() {av_register_all(); });
                                               ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:27:
/usr/include/libavformat/avformat.h:2043:6: note: declared here
 void av_register_all(void);
      ^~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp: In lambda function:
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:47:52: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
   std::call_once(flag2, []() {avcodec_register_all(); });
                                                    ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:26:
/usr/include/libavcodec/avcodec.h:4102:6: note: declared here
 void avcodec_register_all(void);
      ^~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:47:52: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
   std::call_once(flag2, []() {avcodec_register_all(); });
                                                    ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:26:
/usr/include/libavcodec/avcodec.h:4102:6: note: declared here
 void avcodec_register_all(void);
      ^~~~~~~~~~~~~~~~~~~~
[100%] Built target DGEngine
@ghost
Copy link

ghost commented Oct 3, 2019

Do these warnings still happen? I updated rapidjson and I don't get the sfeMovie warnings.

you can see what I get:

Build status

@mewmew
Copy link
Contributor Author

mewmew commented Oct 3, 2019

Hi @dgengin,

Really exciting to see your latest work on DGEngine. I love the way that the new shadow handling looks like.

Do these warnings still happen? I updated rapidjson and I don't get the sfeMovie warnings.

The sfeMovie and rapidjson warnings have indeed been fixed.

The remaining warnings seem to be related to avcodec, the memset call in A* and the signed vs unsigned int comparison in assert(tile.blockHeadersPointer == fileStream.position()).

Scanning dependencies of target DGEngine
[ 35%] Building CXX object CMakeFiles/DGEngine.dir/src/Game/LevelMap.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:43,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:4,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:2:
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h: In instantiation of ‘FixedSizeAllocator<USER_TYPE>::FixedSizeAllocator(unsigned int) [with USER_TYPE = AStarSearch<MapSearchNode>::Node]’:
/home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:139:26:   required from ‘AStarSearch<UserState>::AStarSearch(int) [with UserState = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:16:75:   required from ‘AStarMapSearch<T>::AStarMapSearch(const LevelMap*) [with T = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:552:28:   required from here
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:87:9: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’; use assignment or value-initialization instead [-Wclass-memaccess]
   87 |   memset( m_pMemory, 0, sizeof( FSA_ELEMENT ) * m_MaxElements );
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:64:9: note: ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’ declared here
   64 |  struct FSA_ELEMENT
      |         ^~~~~~~~~~~
[ 91%] Building CXX object CMakeFiles/DGEngine.dir/src/sfeMovie/Demuxer.cpp.o
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp: In lambda function:
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:46:47: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
   46 |   std::call_once(flag1, []() {av_register_all(); });
      |                                               ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:27:
/usr/include/libavformat/avformat.h:2050:6: note: declared here
 2050 | void av_register_all(void);
      |      ^~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:46:47: warning: ‘void av_register_all()’ is deprecated [-Wdeprecated-declarations]
   46 |   std::call_once(flag1, []() {av_register_all(); });
      |                                               ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:27:
/usr/include/libavformat/avformat.h:2050:6: note: declared here
 2050 | void av_register_all(void);
      |      ^~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp: In lambda function:
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:47:52: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
   47 |   std::call_once(flag2, []() {avcodec_register_all(); });
      |                                                    ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:26:
/usr/include/libavcodec/avcodec.h:4159:6: note: declared here
 4159 | void avcodec_register_all(void);
      |      ^~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:47:52: warning: ‘void avcodec_register_all()’ is deprecated [-Wdeprecated-declarations]
   47 |   std::call_once(flag2, []() {avcodec_register_all(); });
      |                                                    ^
In file included from /home/u/Desktop/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:26:
/usr/include/libavcodec/avcodec.h:4159:6: note: declared here
 4159 | void avcodec_register_all(void);
      |      ^~~~~~~~~~~~~~~~~~~~
[ 99%] Building CXX object CMakeFiles/DGEngine.dir/src/ImageContainers/DT1ImageContainer.cpp.o
In file included from /usr/include/c++/9.1.0/cassert:44,
                 from /home/u/Desktop/diablo/DGEngine/./src/gsl/multi_span:26,
                 from /home/u/Desktop/diablo/DGEngine/./src/gsl/gsl:30,
                 from /home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:4:
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp: In constructor ‘DT1ImageContainer::DT1ImageContainer(std::string_view)’:
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:333:35: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘endian::detail::stream<const unsigned char*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  333 |   assert(tile.blockHeadersPointer == fileStream.position());
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:340:61: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘endian::detail::stream<const unsigned char*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  340 |    assert(tile.blockHeadersPointer + blockHeader.fileOffset == fileStream.position());
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking CXX executable DGEngine
[100%] Built target DGEngine

Cheers!

@ghost
Copy link

ghost commented Oct 3, 2019

Thanks 😀. It looks like those calls were deprecated in FFmpeg 4. I was using v2, so I wasn't getting those. They will be fixed in the near future.

@grantramsay
Copy link
Contributor

grantramsay commented Oct 3, 2019

Here's a couple fixes I've been running locally that might help (can't remember exactly why I added them, also I'm running mac/clang):

  • src/sfeMovie/Demuxer.cpp
    Screen Shot 2019-10-03 at 10 43 21 PM
  • src/Game/LevelMap.h
    Screen Shot 2019-10-03 at 10 45 16 PM
  • CMakeLists.txt
    add_definitions(-Wno-overloaded-virtual)

@ghost
Copy link

ghost commented Oct 3, 2019

Those should be fixed now (except for the warning of overloaded virtual in clang)

@mewmew
Copy link
Contributor Author

mewmew commented Oct 3, 2019

Those should be fixed now (except for the warning of overloaded virtual in clang)

Wonderful.

Only two warnings remaining.

  • memset
  • assert comparison between signed and unsigned int.
[ 35%] Building CXX object CMakeFiles/DGEngine.dir/src/Game/LevelMap.cpp.o
In file included from /home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:43,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:4,
                 from /home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:2:
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h: In instantiation of ‘FixedSizeAllocator<USER_TYPE>::FixedSizeAllocator(unsigned int) [with USER_TYPE = AStarSearch<MapSearchNode>::Node]’:
/home/u/Desktop/diablo/DGEngine/src/Game/stlastar.h:139:26:   required from ‘AStarSearch<UserState>::AStarSearch(int) [with UserState = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/PathFinder.h:16:75:   required from ‘AStarMapSearch<T>::AStarMapSearch(const LevelMap*) [with T = MapSearchNode]’
/home/u/Desktop/diablo/DGEngine/src/Game/LevelMap.cpp:552:28:   required from here
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:87:9: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’; use assignment or value-initialization instead [-Wclass-memaccess]
   87 |   memset( m_pMemory, 0, sizeof( FSA_ELEMENT ) * m_MaxElements );
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/Game/fsa.h:64:9: note: ‘struct FixedSizeAllocator<AStarSearch<MapSearchNode>::Node>::FSA_ELEMENT’ declared here
   64 |  struct FSA_ELEMENT
      |         ^~~~~~~~~~~
[ 99%] Building CXX object CMakeFiles/DGEngine.dir/src/ImageContainers/DT1ImageContainer.cpp.o
In file included from /usr/include/c++/9.1.0/cassert:44,
                 from /home/u/Desktop/diablo/DGEngine/./src/gsl/multi_span:26,
                 from /home/u/Desktop/diablo/DGEngine/./src/gsl/gsl:30,
                 from /home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:4:
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp: In constructor ‘DT1ImageContainer::DT1ImageContainer(std::string_view)’:
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:333:35: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘endian::detail::stream<const unsigned char*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  333 |   assert(tile.blockHeadersPointer == fileStream.position());
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/u/Desktop/diablo/DGEngine/src/ImageContainers/DT1ImageContainer.cpp:340:61: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘endian::detail::stream<const unsigned char*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  340 |    assert(tile.blockHeadersPointer + blockHeader.fileOffset == fileStream.position());
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

@dgcor
Copy link
Owner

dgcor commented May 15, 2021

No warnings in GCC and MSVC (I hope). some in Clang. I had to change the stlastar include so I ended up fixing the memset by using a vector instead.

@mewmew
Copy link
Contributor Author

mewmew commented May 16, 2021

Two warnings using GCC 11.0 on Arch Linux, both related to deprecated API.

/home/u/life/projects/diablo/DGEngine/src/sfeMovie/Stream.cpp: In member function ‘virtual AVPacket* sfe::Stream::popEncodedData()’:
/home/u/life/projects/diablo/DGEngine/src/sfeMovie/Stream.cpp:148:47: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  148 |                                 av_init_packet(flushPacket);
      |                                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/libavcodec/bsf.h:30,
                 from /usr/include/libavcodec/avcodec.h:44,
                 from /home/u/life/projects/diablo/DGEngine/src/sfeMovie/Stream.cpp:26:
/usr/include/libavcodec/packet.h:488:6: note: declared here
  488 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
/home/u/life/projects/diablo/DGEngine/src/sfeMovie/Demuxer.cpp: In member function ‘AVPacket* sfe::Demuxer::readPacket()’:
/home/u/life/projects/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:364:31: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  364 |                 av_init_packet(pkt);
      |                 ~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/libavcodec/bsf.h:30,
                 from /usr/include/libavcodec/avcodec.h:44,
                 from /home/u/life/projects/diablo/DGEngine/src/sfeMovie/Demuxer.cpp:26:
/usr/include/libavcodec/packet.h:488:6: note: declared here
  488 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants