8

I am trying to write some parsers with boost.spirit.qi but when i am compiling i am getting the following deprecated warnings:

In file included from /usr/include/boost/iostreams/detail/is_dereferenceable.hpp:12:0 ... 

#pragma message: NOTE: Use of this header (bool_trait_def.hpp) is deprecated

#pragma message: NOTE: Use of this header (template_arity_spec.hpp) is deprecated

Am i using the wrong parsers or something old? How can I get rid of these warnings?

EDIT: The /usr/include/boost/iostreams/detail/is_dereferenceable.hpp is somehow included by /usr/include/boost/spirit/include/qi.hpp I am using Boost Version 1.61

Exagon
  • 4,798
  • 6
  • 25
  • 53
  • It's rather difficult to tell you what you're doing wrong when you don't show the code (or at least the part of it with include directives). There's also more than 1 version of boost in existence, so it would be useful to indicate which one you're actually using. Finally, `boost/iostreams/detail/...` doesn't look like `boost.spirit` (althought it could possibly be included, there are a few iterator classes i see that depend on things from iostreams). – Dan Mašek May 22 '16 at 13:42
  • 1
    I have the same warnings. They're annoying. I hoped they'd be gone in boost 1.61. Perhaps you should report them at the mailing list/boost trac/github repo for boost spirit – sehe May 22 '16 at 16:08
  • 6
    The real culprit here is Boost.Iostream, which Spirit uses internally. As of Boost 1.61, Boost.Iostream is still using Boost.TypeTraits's deprecated header files (`bool_trait_def.hpp` and `template_arity_spec.hpp`). This issue is reported at [Ticket #11886](https://svn.boost.org/trac/boost/ticket/11886). – dkim May 22 '16 at 16:54
  • 1
    For a shift, you can mark `/usr/include`, where your Boost header files are located, as a system directory by specifying the GCC (or Clang) command-line option `-isystem /usr/include`. All warnings, other than those generated by `#warning`, are suppressed for header files in system directories. Refer to [The C Preprocessor](https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html) for more details. – dkim May 22 '16 at 17:05
  • 1
    @dkim that certainly doesn't fix it for me; `#pragma message()` is clearly also exempt. I know because I run with `-isystem` since forever – sehe May 22 '16 at 19:07
  • 1
    @sehe I have checked again that the stopgap works with Clang (included in Xcode 7.3.1). GCC's `-isystem` appears to work differently than Clang's. Good to know. Thanks! – dkim May 23 '16 at 11:18

1 Answers1

4

I had a similar issue using the boost geometry package and could not upgrade boost to fix the error.

Disable boost deprecated warnings with the below define:

#define BOOST_ALLOW_DEPRECATED_HEADERS
#define BOOST_BIND_GLOBAL_PLACEHOLDERS

Note the second define handles a common warning that occurs alongside of the deprecated warning and may not be needed.

VoteCoffee
  • 4,692
  • 1
  • 41
  • 44