Skip to content
New issue

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

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

Already on GitHub? # to your account

Problem with macro deprecated #2767

Closed
Jamaika1 opened this issue Sep 6, 2021 · 4 comments
Closed

Problem with macro deprecated #2767

Jamaika1 opened this issue Sep 6, 2021 · 4 comments
Assignees
Labels
release-blocking Must be done by the release

Comments

@Jamaika1
Copy link

Jamaika1 commented Sep 6, 2021

GCC 12.0.0 20210826 X86_64 Windows 10

zbuff_compress.c: In function 'ZBUFF_compressInit_advanced':
zbuff_compress.c:76:5: warning: 'ZSTD_initCStream_advanced' is deprecated [-Wdeprecated-declarations]
   76 |     return ZSTD_initCStream_advanced(zbc, dict, dictSize, params, pledgedSrcSize);
      |     ^~~~~~
In file included from zbuff.h:189,
                 from zbuff_compress.c:17:
zstd.h:2216:8: note: declared here
 2216 | size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~
zbuff_compress.c: In function 'ZBUFF_compressInitDictionary':
zbuff_compress.c:82:5: warning: 'ZSTD_initCStream_usingDict' is deprecated [-Wdeprecated-declarations]
   82 |     return ZSTD_initCStream_usingDict(zbc, dict, dictSize, compressionLevel);
      |     ^~~~~~
In file included from zbuff.h:189,
                 from zbuff_compress.c:17:
zstd.h:2196:8: note: declared here
 2196 | size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
@Cyan4973
Copy link
Contributor

Not sure which application you are compiling,
but we would like to invite you to no longer use ZBUFF_,
which is an old API that has been deprecated a long time ago.
Prefer using stable APIs, which are fully supported now and in the future, and offer all the capabilities of ZBUFF_ and more.

@terrelln
Copy link
Contributor

terrelln commented Sep 24, 2021

We no longer build zbuff as part of the library, unless deprecated APIs have been explicitly enabled. And we're planning on removing the source code from the library at some point in the future. So I strongly recommend you move away from the API.

However, if you are blocked by this in the short term, you can use -Wno-deprecated-declarations to silence the warning. But again, this will only work for so long, because we will be deleting this code.

@Jamaika1
Copy link
Author

Jamaika1 commented Sep 25, 2021

I use ZSTDLIB_VISIBILITY=ZSTDLIB_API=/"/"
Adding ZBUFF_ doesn't fix anything

@felixhandte felixhandte self-assigned this Nov 23, 2021
@terrelln terrelln added release-blocking Must be done by the release and removed build labels Nov 23, 2021
felixhandte added a commit to felixhandte/zstd that referenced this issue Dec 2, 2021
`lib/deprecated` is no longer built by zstd's bundled build files. However,
users may try to build these files when they import the source tree into
their own build systems. And if they have `-Wdeprecated-declarations` on,
this can produce warnings.

This PR migrates these files away from using deprecated declarations.

This addresses facebook#2767.
@felixhandte
Copy link
Contributor

The linked PR should fix this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
release-blocking Must be done by the release
Projects
None yet
Development

No branches or pull requests

4 participants