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

fix warning on bitwise operator with boolean operands #132

Merged
merged 1 commit into from
Apr 4, 2022
Merged

fix warning on bitwise operator with boolean operands #132

merged 1 commit into from
Apr 4, 2022

Conversation

t0b3
Copy link
Contributor

@t0b3 t0b3 commented Apr 4, 2022

clang 14 -Werror throws warning

  cpp/lazperf/detail/field_rgb14.cpp:58:11:
  error: use of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]

more details see https://cdash.orfeo-toolbox.org/viewBuildError.php?buildid=95486

reason is operator | expects bitwise operand but gets boolean operand as per function definition flag_diff returns bool
https://github.com/hobu/laz-perf/blob/faede41102a65b8c83b21edbd120a000316611da/cpp/lazperf/detail/field_rgb14.cpp#L46

issue was detected downstream in qgis with ci pipeline on fedora 36 using clang 14
while working on qgis/QGIS#47887

clang 14 -Werror throws warning
  cpp/lazperf/detail/field_rgb14.cpp:58:11:
  error: use of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]
t0b3 added a commit to t0b3/QGIS that referenced this pull request Apr 4, 2022
error with clang 14
  external/lazperf/detail/field_rgb14.cpp:58:11
  error: use of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]

  ((flag_diff(b.r, b.g, 0x00FF) |
   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ||

see also upstream hobuinc/laz-perf#132
@abellgithub abellgithub merged commit d0d47aa into hobuinc:master Apr 4, 2022
t0b3 added a commit to t0b3/QGIS that referenced this pull request Apr 7, 2022
error with clang 14
  external/lazperf/detail/field_rgb14.cpp:58:11
  error: use of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]

  ((flag_diff(b.r, b.g, 0x00FF) |
   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ||

see also upstream hobuinc/laz-perf#132
nyalldawson pushed a commit to qgis/QGIS that referenced this pull request Apr 8, 2022
error with clang 14
  external/lazperf/detail/field_rgb14.cpp:58:11
  error: use of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]

  ((flag_diff(b.r, b.g, 0x00FF) |
   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                ||

see also upstream hobuinc/laz-perf#132
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

Successfully merging this pull request may close these issues.

None yet

2 participants