Disable gcc deprecation warnings in places where we can't don anything about it

This commit is contained in:
Ivan Skytte Jørgensen 2018-10-09 15:41:00 +02:00
parent ec09ad81be
commit 6e30dee3d3
2 changed files with 11 additions and 0 deletions

View File

@ -70,6 +70,11 @@ bool Dir::open ( ) {
return true;
}
//Disable deprecated-declarations about use of readdir_r(). the glib maintainers deprecate readdir_r() because the linux
//version of readdir() is thread-safe. But the maintainers didn't think of other platforms, so that deprecation is
//linux-centric and not portable.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
const char *Dir::getNextFilename(const char *pattern) {
if (!m_dir) {
log("dir: m_dir is NULL so can't find pattern %s", pattern);
@ -91,3 +96,4 @@ const char *Dir::getNextFilename(const char *pattern) {
return NULL;
}
#pragma GCC diagnostic pop

View File

@ -133,6 +133,10 @@ void Mem::delnew ( void *ptr , size_t size , const char *note ) {
return;
}
//dynamic throw(...) may be deprecated by the signatures for new and new[] must be exactly like this
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
// . global override of new and delete operators
// . seems like constructor and destructor are still called
// . just use to check if enough memory
@ -208,6 +212,7 @@ void * operator new [] (size_t size) throw (std::bad_alloc) {
return mem;
}
#pragma GCC diagnostic pop
Mem::Mem() {