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

Use [[nodiscard]] on some methods #179

Open
robUx4 opened this issue Dec 23, 2023 · 1 comment
Open

Use [[nodiscard]] on some methods #179

robUx4 opened this issue Dec 23, 2023 · 1 comment
Labels
api-break breaks the API (e.g. programs using it will have to adjust their source code)

Comments

@robUx4
Copy link
Contributor

robUx4 commented Dec 23, 2023

The result of some methods like EbmlElement::SetSizeInfinite() or IOCallback::write() should be checked.

In the case of SetSizeInfinite() the function cannot fail when setting false, so we might split the call in 2 and only return an status when setting to infinite.

@neheb pointed out that unknown attributes should be ignored, so we can safely enable it (attributes are from C+11).

BTW plenty of C++ attributes like this are making their way into C23.

@robUx4 robUx4 added abi-break breaks the ABI (e.g. programs linked against the library have to be recompiled) api-break breaks the API (e.g. programs using it will have to adjust their source code) and removed abi-break breaks the ABI (e.g. programs linked against the library have to be recompiled) labels Dec 23, 2023
@neheb
Copy link
Contributor

neheb commented Dec 23, 2023

Yeah C++ standard demands unknown attributes be ignored. Will be shown with proper warnings enabled though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break breaks the API (e.g. programs using it will have to adjust their source code)
Projects
None yet
Development

No branches or pull requests

2 participants