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

Move ZSTD_DEPRECATED before ZSTDLIB_API/ZSTDLIB_STATIC_API #3273

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

MaskRay
Copy link
Contributor

@MaskRay MaskRay commented Sep 22, 2022

Clang doesn't allow [[deprecated(...)]] attribute after __attribute__. Move [[deprecated(...)]] before __attribute__ to fix C++14/C++17 uses with Clang.

Fix #3250


The error looks like:

/tmp/opt/zstd/include/zstd.h:191:1: error: an attribute list cannot appear here
ZSTD_DEPRECATED("Replaced by ZSTD_getFrameContentSize")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/opt/zstd/include/zstd.h:49:38: note: expanded from macro 'ZSTD_DEPRECATED'
#    define ZSTD_DEPRECATED(message) [[deprecated(message)]]
                                     ^~~~~~~~~~~~~~~~~~~~~~~

@MaskRay MaskRay changed the title Move ZSTD_DEPRECATED before ZSTDLIB_STATIC_API Move ZSTD_DEPRECATED before ZSTDLIB_API/ZSTDLIB_STATIC_API Sep 22, 2022
@Cyan4973
Copy link
Contributor

This change incorrectly makes ZSTD_compressBegin_usingCDict() deprecated, but it's not.

The deprecation warning was meant for the next symbol, ZSTD_copyCCtx().

#3274 is being pushed, in the hope that it helps clarity.

Clang doesn't allow [[deprecated(...)]] attribute after __attribute__.
Move [[deprecated(...)]] before __attribute__ to fix C++14/C++17 uses
with Clang.

Fix facebook#3250
@MaskRay
Copy link
Contributor Author

MaskRay commented Sep 26, 2022

All tests passed :)

@Cyan4973 Cyan4973 merged commit 096dccb into facebook:dev Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building with c++14/17 fails on clang
3 participants