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

Ambiguous bool to int conversion #58

Open
hfiguiere opened this issue Apr 9, 2022 · 0 comments
Open

Ambiguous bool to int conversion #58

hfiguiere opened this issue Apr 9, 2022 · 0 comments

Comments

@hfiguiere
Copy link

This is triggered by clang -Wint-in-bool-context

XMPFiles/source/FileHandlers/FLV_Handler.cpp:200:55: warning: converting the result of '<<' to a boolean; did you mean '(buffer[7] << 24) != 0'? [-Wint-in-bool-context]
        info->time = GetUns24BE ( &buffer[4] ) || (buffer[7] << 24);
                                                             ^
1 warning generated.

Expected Behaviour

Properly written code, no warning.

Actual Behaviour

Seems to want to put a bool value into an XMP_Uns32 with implicit conversion. Seems to be wrong.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Build with clang (Linux) with -Wint-in-bool-context

Platform and Version

clang version 13.0.0 (Fedora 13.0.0-3.fc35)

Sample Code that illustrates the problem

Logs taken while reproducing problem

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

1 participant