deprecated warnings while using boost.spirit
Asked Answered
S

1

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

Salutatory answered 22/5, 2016 at 9:59 Comment(6)
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).Panpsychist
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 spiritResonate
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.Pani
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 for more details.Pani
@Pani that certainly doesn't fix it for me; #pragma message() is clearly also exempt. I know because I run with -isystem since foreverResonate
@Resonate 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!Pani
A
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.

Ab answered 8/6, 2021 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.