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

Compiler warning about changed sign for uint #6

Closed
jkwashbourne-oss opened this issue Apr 19, 2024 · 2 comments
Closed

Compiler warning about changed sign for uint #6

jkwashbourne-oss opened this issue Apr 19, 2024 · 2 comments

Comments

@jkwashbourne-oss
Copy link

jkwashbourne-oss commented Apr 19, 2024

I started testing with lzav and find this compiler warning, which makes me nervous considering uint LHS. Cheers

"lzav.h", line 653: warning: integer conversion resulted in a change of sign [integer_sign_change]
                uint32_t ov = (uint32_t) ( 255 << 24 | d << 6 | 2 << 4 );
                                           ^

"lzav.h", line 664: warning: integer conversion resulted in a change of sign [integer_sign_change]
        uint32_t ov = (uint32_t) ( 255 << 24 | d >> 2 );
                                   ^
@avaneev
Copy link
Owner

avaneev commented May 30, 2024

Could you please try inserting (uint32_t) 255 in these cases? If that works, I'll update the code soon. Compilers I use do not show the warning.

@avaneev
Copy link
Owner

avaneev commented Jun 2, 2024

I've changed the code, hopefully it fixes the warning.

@avaneev avaneev closed this as completed Jun 2, 2024
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