fileio: use the prefixed lz4frame type LZ4F_contentChecksum_t

Open Beginner friendly
#4,897 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
backend

Research direction

Start in programs/fileio.c and inspect the LZ4_VERSION_NUMBER <= 10600 compatibility block and the checksum cast described in the issue. Update the obsolete enum usage and compatibility definition as suggested, then build zstd with lz4 support, including a build with -Werror. Done when supported lz4 versions compile without deprecated enum warnings.

Written by the indexing model from the issue text.

Description

programs/fileio.c defines LZ4F_ENABLE_OBSOLETE_ENUMS and employs contentChecksum_t, an unprefixed name obsolete since lz4 v1.7.0.

  • lz4 v1.11.0 removed these names : zstd no longer builds with lz4 support (lz4/lz4#2046).
  • lz4 v1.11.1 restores them (lz4/lz4#2053), but deprecated : a compilation warning, an error with -Werror.

Suggested fix :

  • (LZ4F_contentChecksum_t)checksumFlag
  • drop #define LZ4F_ENABLE_OBSOLETE_ENUMS
  • in the LZ4_VERSION_NUMBER <= 10600 block, add #define LZ4F_contentChecksum_t contentChecksum_t
Dominant language
C
Stars
28.1k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebook/zstd

All issues in facebook/zstd

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.