2

Using gcc with -std=c++11

pkg-config libxml++-2.6 --modversion

2.40.1

get lots of warnings like this: /usr/include/libxml++-2.6/libxml++/parsers/saxparser.h:224:8: warning: 'template class std::auto_ptr' is deprecated [-Wdeprecated-declarations]

  1. I may follow the recommendation and disable this warning but I may miss other warnings in future.
  2. I may try latest libxml++ version 2.91; despite huge minor(lol) version difference it's at most one month younger; I'll build this on older machines where libxml++ will probably be older.

I'll ignore this warning. Would anybody do otherwise ?

Andu
  • 43
  • 6

3 Answers3

0

You should be safe ignoring the std::auto_ptr warning. Prior to C++11, auto_ptr was a common way to manage memory, because it takes ownership of a pointer. Post C++11 it's recommended to use the new smart pointers that are part of STL (ie std::unique_ptr, std::shared_ptr).

This question has a good discussion on std::auto_ptr and issues that led to it being deprecated. I wouldn't write new code using it, but existing code using auto_ptr should be safe (assuming there aren't bugs to begin with which may or may not be valid).

Jarod42
  • 203,559
  • 14
  • 181
  • 302
efunkh
  • 311
  • 1
  • 6
0

Well, there is a better-than-average chance that auto_ptr will be removed from C++17. So I would be at least somewhat concerned about relying on software that made use of it.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • 1
    It seems it's already fixed into latest version. The NEWS file states for version2.91.1 (unstable): * Replace the deprecated std::auto_ptr by std::unique_ptr – Andu Jan 10 '16 at 08:43
0

You could replace your libxml++ version by a version higher or equal than 2.9.1 They fixed the auto_ptr thing and replaced it by unique_ptr. Although you have to install libxml++-2.9.1 by hand by downloading it from:

http://ftp.gnome.org/pub/GNOME/sources/libxml++/

hope it helps.