Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘void (* std::set_unexpected(unexpected_handler))()’ is deprecated [-Werror=deprecated-declarations] #27

Open
kevung opened this issue Jul 10, 2023 · 6 comments

Comments

@kevung
Copy link

kevung commented Jul 10, 2023

Dear Stephane,

Context:
OS= Arch Linux
GCC 13.1.1

After cloning, mkdir build, cd build, cmake .., cmake --build .,
I get the following error

unger% cmake --build . --parallel 15
[ 10%] Built target dm_launcher
[ 18%] Built target dm_darknet
[ 34%] Built target dm_juce
[ 48%] Built target dm_wnd
[ 68%] Built target dm_tools
[ 94%] Built target dm_darkmark
[ 96%] Building CXX object src-main/CMakeFiles/DarkMark.dir/DarkMarkApp.cpp.o
/home/unger/src/DarkMark/src-main/DarkMarkApp.cpp: In member function ‘virtual void dm::DarkMarkApplication::initialise(const juce::String&)’:
/home/unger/src/DarkMark/src-main/DarkMarkApp.cpp:248:28: error: ‘void (* std::set_unexpected(unexpected_handler))()’ is deprecated [-Werror=deprecated-declarations]
  248 |         std::set_unexpected(DarkMark_CPlusPlus_Unexpected_Handler);
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13.1.1/ios:41,
                 from /usr/include/c++/13.1.1/istream:40,
                 from /usr/include/c++/13.1.1/fstream:40,
                 from /home/unger/src/DarkMark/src-main/DarkMark.hpp:6,
                 from /home/unger/src/DarkMark/src-main/DarkMarkApp.cpp:3:
/usr/include/c++/13.1.1/exception:89:22: note: declared here
   89 |   unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
      |                      ^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src-main/CMakeFiles/DarkMark.dir/build.make:76: src-main/CMakeFiles/DarkMark.dir/DarkMarkApp.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:403: src-main/CMakeFiles/DarkMark.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Thank you for your work
I stay at your disposal for further information.
Take care

Kevin

@stephanecharette
Copy link
Owner

Are you blocked, or do you know how to get past this error?

@kevung
Copy link
Author

kevung commented Jul 10, 2023

Hello Stephane,
As indicated in #26 (comment) (I posted by mistake in the wrong issue), this function has been removed in C++ 17.

I'm still currently blocked by this error. I'll try to bypass it maybe by deleting the mentionned lines in the source code.
Does DarkMark should be compiled against a specific C++ standard?
In https://github.com/stephanecharette/DarkMark/blob/master/CM_definitions.cmake, C++ 17 is chosen.

Bye
Kévin

@stephanecharette
Copy link
Owner

stephanecharette commented Jul 10, 2023

You can remove the -Werror flag in the CMake file, or you can comment out line #248 which is causing this warning to be issued.

I'm still on an older version of GCC/G++ which is why I'm not seeing this warning.

@kevung
Copy link
Author

kevung commented Jul 10, 2023

Thank you very much.
I indeed could successfully compile DarkMark by desactivating -Werror in https://github.com/stephanecharette/DarkMark/blob/master/CM_source.cmake#L28

As it is not a bug, but maybe a regression, I close this ticket.
Thank you very much for your assistance.

@kevung kevung closed this as completed Jul 10, 2023
@stephanecharette
Copy link
Owner

stephanecharette commented Jul 10, 2023

Re-opening since this will need to be dealt with.

@stephanecharette
Copy link
Owner

This should be fixed by e7a4dae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants