Bug 28830 - GCC 12 warnings
Summary: GCC 12 warnings
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-27 14:07 UTC by Martin Liska
Modified: 2022-01-28 17:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liska 2022-01-27 14:07:38 UTC
I see new GCC 12 warnings:

[   49s] util.cxx: In function 'void ltrim(std::string&)':
[   49s] util.cxx:1699:56: error: 'std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]' is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
[   49s]  1699 |                        std::not1(std::ptr_fun<int, int>(std::isspace))));
[   49s]       |                                  ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
[   49s] In file included from /usr/include/c++/12/string:48,
[   49s]                  from util.h:8,
[   49s]                  from util.cxx:17:
[   49s] /usr/include/c++/12/bits/stl_function.h:1126:5: note: declared here
[   49s]  1126 |     ptr_fun(_Result (*__x)(_Arg))
[   49s]       |     ^~~~~~~
[   49s] util.cxx:1699:33: error: 'constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = pointer_to_unary_function<int, int>]' is deprecated: use 'std::not_fn' instead [-Werror=deprecated-declarations]
[   49s]  1699 |                        std::not1(std::ptr_fun<int, int>(std::isspace))));
[   49s]       |                        ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   49s] /usr/include/c++/12/bits/stl_function.h:1046:5: note: declared here
[   49s]  1046 |     not1(const _Predicate& __pred)
[   49s]       |     ^~~~
[   49s] util.cxx: In function 'void rtrim(std::string&)':
[   49s] util.cxx:1707:43: error: 'std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]' is deprecated: use 'std::function' instead [-Werror=deprecated-declarations]
[   49s]  1707 |           std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
[   49s]       |                     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
[   49s] /usr/include/c++/12/bits/stl_function.h:1126:5: note: declared here
[   49s]  1126 |     ptr_fun(_Result (*__x)(_Arg))
[   49s]       |     ^~~~~~~
Comment 1 Frank Ch. Eigler 2022-01-28 17:46:40 UTC
The ptr_fun related g++ warnings were corrected recently.
commit f199d1982ef8
commit 56c498d95