Commit 8dd52dd1 authored by Davis King's avatar Davis King

Minor changes to avoid compiler warnings in newer versions of GCC.

parent 3e9b7ebb
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
// GCC 4.8 gives false alarms about some variables being uninitialized. Disable these // GCC 4.8 gives false alarms about some variables being uninitialized. Disable these
// false warnings. // false warnings.
#if ( defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 8) #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 8) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif #endif
#include "../enable_if.h" #include "../enable_if.h"
...@@ -403,6 +404,10 @@ namespace dlib ...@@ -403,6 +404,10 @@ namespace dlib
} }
#if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 8) || (__GNUC__ > 4))
#pragma GCC diagnostic pop
#endif
#endif // DLIB_MATRIx_ASSIGn_FWD_ #endif // DLIB_MATRIx_ASSIGn_FWD_
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
// GCC 4.8 gives false alarms about some matrix operations going out of bounds. Disable // GCC 4.8 gives false alarms about some matrix operations going out of bounds. Disable
// these false warnings. // these false warnings.
#if ( defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 8) #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 8) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif #endif
namespace dlib namespace dlib
...@@ -902,5 +903,9 @@ namespace dlib ...@@ -902,5 +903,9 @@ namespace dlib
} }
#if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 8) || (__GNUC__ > 4))
#pragma GCC diagnostic pop
#endif
#endif // DLIB_MATRIx_DATA_LAYOUT_ #endif // DLIB_MATRIx_DATA_LAYOUT_
...@@ -74,7 +74,7 @@ namespace dlib ...@@ -74,7 +74,7 @@ namespace dlib
) )
{ {
bool my_fault = true; bool my_fault = true;
uint64 this_con_id; uint64 this_con_id=0;
try try
{ {
sockstreambuf buf(&con); sockstreambuf buf(&con);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of // Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning. // this file that re-enables the warning.
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
...@@ -527,7 +527,7 @@ namespace dlib ...@@ -527,7 +527,7 @@ namespace dlib
} }
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of // Don't warn about the use of std::auto_ptr in this file. There is a pragma at the end of
// this file that re-enables the warning. // this file that re-enables the warning.
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
...@@ -497,7 +497,7 @@ namespace dlib ...@@ -497,7 +497,7 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 #if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
...@@ -283,8 +283,10 @@ namespace ...@@ -283,8 +283,10 @@ namespace
matrix<double,2,1> rosen_residual_derivative_double (int i, const matrix<double,2,1>& m) matrix<double,2,1> rosen_residual_derivative_double (int i, const matrix<double,2,1>& m)
{ return rosen_residual_derivative(i,m); } { return rosen_residual_derivative(i,m); }
/*
matrix<float,2,1> rosen_residual_derivative_float (int i, const matrix<float,2,1>& m) matrix<float,2,1> rosen_residual_derivative_float (int i, const matrix<float,2,1>& m)
{ return rosen_residual_derivative(i,m); } { return rosen_residual_derivative(i,m); }
*/
double rosen_big_residual_double (int i, const matrix<double,2,1>& m) double rosen_big_residual_double (int i, const matrix<double,2,1>& m)
{ return rosen_big_residual(i,m); } { return rosen_big_residual(i,m); }
......
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
#include "tester.h" #include "tester.h"
// Don't warn about auto_ptr
#if defined(__GNUC__) && ((__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace namespace
{ {
bool used_array_delete; bool used_array_delete;
......
...@@ -43,7 +43,7 @@ extern "C" ...@@ -43,7 +43,7 @@ extern "C"
extern int USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_; extern int USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_;
inline int dlib_check_consistent_assert_usage() { USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ = 0; return 0; } inline int dlib_check_consistent_assert_usage() { USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_ = 0; return 0; }
#endif #endif
const int dlib_check_assert_helper_variable = dlib_check_consistent_assert_usage(); const int DLIB_NO_WARN_UNUSED dlib_check_assert_helper_variable = dlib_check_consistent_assert_usage();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment