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

COMPAT_FLAGS_INVALID is a valid value, makes all usage of it bugs. #29

Open
bignaux opened this issue Mar 29, 2021 · 0 comments
Open

COMPAT_FLAGS_INVALID is a valid value, makes all usage of it bugs. #29

bignaux opened this issue Mar 29, 2021 · 0 comments
Labels

Comments

@bignaux
Copy link
Member

bignaux commented Mar 29, 2021

Example :

hdl_dump modify /dev/sdb Netflix +1+2+3+4+5+6+7+8
=> CD  1250944KB   1+2+3+4+5+6+7 *u4 SLUS21949    +1+2+3+4+5+6+7+8

The issue is that compat_flags_t is a uchar, and with 8 modes, all bits are useful, so we can't rely on an invalid value.

if (new_flags == COMPAT_FLAGS_INVALID)

typedef unsigned char compat_flags_t;
static const compat_flags_t COMPAT_FLAGS_INVALID = (compat_flags_t)-1;

I'm not interesting to fix that now since mode are not useful for me (using OPL), and that's used everywhere (big impact and work for no use). But i can write a bug reminder near declaration of COMPAT_FLAGS_INVALID.
If we use a bigger type int to keep the invalid value mecanism, we break for example the hdl_hdr mapping...

@AKuHAK AKuHAK added the bug label May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants