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

api: extend va_deprecate to modern c/c++ and MSVC #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,22 @@
extern "C" {
#endif

#if defined(__GNUC__) && !defined(__COVERITY__)
#if defined(__cplusplus) && __cplusplus >= 201402L
#define va_deprecated [[deprecated]]
#define va_deprecated_enum [[deprecated]]
#elif __STDC__ && __STDC_VERSION__ >= 202311L
#define va_deprecated [[deprecated]]
#define va_deprecated_enum [[deprecated]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know how much we care, but this will break Coverity Scan - both within this project and other projects that use libva. See 3921874 for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added notation is a part of C/C++ standard which tools should now or later be capable to understand. Whether Coverity understands above notation as of today - that's a question. I wonder how we can check before the merge? @uartie : do we have a way?

Other than that it's easy to modify PR to expand to nothing for coverity (as it was before).

#elif defined(__GNUC__) && !defined(__COVERITY__)
#define va_deprecated __attribute__((deprecated))
#if __GNUC__ >= 6
#define va_deprecated_enum va_deprecated
#else
#define va_deprecated_enum
#endif
#elif defined(_MSC_VER)
#define va_deprecated __declspec(deprecated)
#define va_deprecated_enum
#else
#define va_deprecated
#define va_deprecated_enum
Expand Down