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

Don't throw exception in svm.cpp #1051

Open
rosetta-jpn opened this issue Jul 1, 2022 · 4 comments
Open

Don't throw exception in svm.cpp #1051

rosetta-jpn opened this issue Jul 1, 2022 · 4 comments

Comments

@rosetta-jpn
Copy link

svm.cpp is only the place of throwing exception in libvmaf.
Looks like the code can be simply replaced with bool + error message.
Does it make sens to remove code so that libvmaf can be built with -fno-exceptions compiler option?

If this is agreed, I will send a pull-request.

Thanks in advance.

@rosetta-jpn
Copy link
Author

Actually, tools/vmaf.cpp also handles std::stoi error handling and also enclose the core vmaf computation function by "try".
I am not sure if vmaf calls some standard function throwing an exception except svm.cpp and std::stoi in main.cpp.

@kylophone
Copy link
Collaborator

kylophone commented Jul 14, 2022

svm.cpp is only the place of throwing exception in libvmaf.
Looks like the code can be simply replaced with bool + error message.
Does it make sens to remove code so that libvmaf can be built with -fno-exceptions compiler option?

Yes, feel free to send a PR for this. libsvm is third-party code, but I think we are OK to patch this file.

Actually, tools/vmaf.cpp also handles std::stoi error handling and also enclose the core vmaf computation function by "try".
I am not sure if vmaf calls some standard function throwing an exception except svm.cpp and std::stoi in main.cpp.

Don't worry about this one. This is an old tool, and should be removed from the codebase.

@rosetta-jpn
Copy link
Author

Thanks for the info. I created a pull request for svm.cpp. #1071
Ideally, once the exceptions in main.cpp are removed, the compiler flag -fno-exceptions should be added to Makefile.

@rosetta-jpn
Copy link
Author

Gentle ping.

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