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

Type of streamIdx in struct IndexPrologue #2

Open
marvin2k opened this issue Dec 10, 2014 · 2 comments
Open

Type of streamIdx in struct IndexPrologue #2

marvin2k opened this issue Dec 10, 2014 · 2 comments

Comments

@marvin2k
Copy link
Contributor

Hi,

the member streamIdx in struct IndexPrologue is of type int16_t, the stream_idx in struct BlockHeader is of uint16_t. Then other places use size_t or even int for stream-indexing.

This triggers a -Wsign-compare here.

Changing the signedness of streamIdx in IndexProloque to uint16_t allows to use the same type for all stream indexing. It will break the on-disk format, but only for files with many streams, which are already broken because of the silent overflow?

Changing the size of the members in IndexPrologue or BlockHeader will change the on-disk format and is not an option.

@marvin2k
Copy link
Contributor Author

marvin2k commented Feb 20, 2017

Well, the problem does not go away by closing the issue ;-) As I recall the referenced PR does explicitly not touch this to keep the on-disk format.

@jmachowinski jmachowinski reopened this Feb 20, 2017
@jmachowinski
Copy link
Contributor

IndexPrologue may actually be changed without a problem. It will just trigger a regeneration of the id2 file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants