Closed incognico closed 8 years ago
Huh. Not sure why I didn't get these warnings when I was working on the port. Anyway, adding -Wno-sign-compare
to CMAKE_CXX_FLAGS should suppress those errors.
Ok thx, but now gsrand.cpp is causing somre more troble:
[ 40%] Building CXX object CMakeFiles/gsrand.dir/src/gsrand.cpp.o
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp: In function ‘void filter_default_content(std::vector<std::basic_string<char
> >&, const char**, int, std::vector<std::basic_string<char> >&, std::string, int&, int&, std::string&)’:
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:384:59: error: suggest parentheses around ‘&&’ within ‘||’ [-Werror=parentheses]
if (contentMode != CONTENT_EVERYTHING || maxContentBytes && search_paths.size() || skipUppercase)
^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:397:11: error: ‘Sleep’ was not declared in this scope
Sleep(5);
^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:417:11: error: use of deleted function function ‘std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)’
fin = ifstream(search_paths[k] + unfiltered[i] + ext, ios::binary);
^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:430:11: note: ‘std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.9/fstream:430:11: error: use of deleted function ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std
::basic_istream<char>&)’
In file included from /usr/include/c++/4.9/iostream:40:0,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/istream:58:11: note: ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/include/c++/4.9/istream:58:11: error: use of deleted function ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_i
os<char>&)’
In file included from /usr/include/c++/4.9/ios:44:0,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’ is i
mplicitly deleted because the default definition would be ill-formed:
class basic_ios : public ios_base
^
In file included from /usr/include/c++/4.9/ios:42:0,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/ios_base.h:789:5: error: ‘std::ios_base& std::ios_base::operator=(const std::ios_base&)’ is private
operator=(const ios_base&);
^
In file included from /usr/include/c++/4.9/ios:44:0,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: error: within this context
class basic_ios : public ios_base
^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:430:11: error: use of deleted function ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std
::basic_filebuf<char>&)’
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.9/fstream:72:11: note: ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)’ i
s implicitly deleted because the default definition would be ill-formed:
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
In file included from /usr/include/c++/4.9/ios:43:0,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/streambuf:810:7: error: ‘std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
operator=(const basic_streambuf&) { return *this; };
^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:72:11: error: within this context
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
cc1plus: all warnings being treated as errors
CMakeFiles/gsrand.dir/build.make:123: recipe for target 'CMakeFiles/gsrand.dir/src/gsrand.cpp.o' failed
make[2]: *** [CMakeFiles/gsrand.dir/src/gsrand.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/gsrand.dir/all' failed
make[1]: *** [CMakeFiles/gsrand.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Sleep() seems to be a Windows only function. Also tested -Wno-parentheses but the other stuff about the deleted function stuff prevents it from compiling.
I'm currently working on getting everything compiling again under posix.
Apply #5 locally, should do the trick.
CC @Yoplitein
Am I missing something or does the code need an update?