Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bitstream: fix BIT_readBits and BIT_reloadDStream prototypes#4562

Open
alex-moch wants to merge 1 commit intofacebook:dev from
alex-moch:bitstream
Open

bitstream: fix BIT_readBits and BIT_reloadDStream prototypes #4562
alex-moch wants to merge 1 commit intofacebook:dev from
alex-moch:bitstream

Conversation

@alex-moch
Copy link

@alex-moch alex-moch commented Jan 1, 2026
edited
Loading

Align the declarations of BIT_readBits() and BIT_reloadDStream() in bitstream.h with their FORCE_INLINE_TEMPLATE definitions.

The previous MEM_STATIC declarations caused an attribute mismatch between the header and the definitions, which can lead to incorrect compiler assumptions under certain toolchains and optimization levels.


 CC [M] zstd/lib/common/entropy_common.o
In file included from /data/zstd/lib/common/fse.h:230,
 from /data/zstd/lib/common/entropy_common.c:22:
/data/zstd/lib/common/bitstream.h:363:40: error: 'gnu_inline' attribute present on 'BIT_readBits'
 363 | FORCE_INLINE_TEMPLATE BitContainerType BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits)
 | ^~~~~~~~~~~~
/data/zstd/lib/common/bitstream.h:106:29: error: but not here
 106 | MEM_STATIC BitContainerType BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
 | ^~~~~~~~~~~~
/data/zstd/lib/common/bitstream.h:413:42: error: 'gnu_inline' attribute present on 'BIT_reloadDStream'
 413 | FORCE_INLINE_TEMPLATE BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
 | ^~~~~~~~~~~~~~~~~
/data/zstd/lib/common/bitstream.h:107:31: error: but not here
 107 | MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
 | ^~~~~~~~~~~~~~~~~

Align the declarations of BIT_readBits() and BIT_reloadDStream() in
bitstream.h with their FORCE_INLINE_TEMPLATE definitions.
The previous MEM_STATIC declarations caused an attribute mismatch
between the header and the definitions, which can lead to incorrect
compiler assumptions under certain toolchains and optimization levels.
Signed-off-by: Alexander Moch <mail@alexmoch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /