Skip to content
Snippets Groups Projects

RFC: Avoid warnings in MSVC builds, add flag for similar warnings for GCC/Clang

Merged Martin Storsjö requested to merge mstorsjo/dav1d:avoid-warnings into master

I'm sure that some of these changes are more acceptable than others; I can split them up in separate merge requests if there are things that are OK to be merged soon while others require more discussion.

This is an alternative to !563 (closed).

Merge request reports

Pipeline #4559 passed

Pipeline passed for 93ab93de on mstorsjo:avoid-warnings

Approval is optional

Merged by Ronald S. BultjeRonald S. Bultje 6 years ago (Feb 12, 2019 10:53pm UTC)

Pipeline #4560 passed

Pipeline passed for 93ab93de on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Some small nits. I think overall I understand the logic behind the changes and although I think it's ugly as sin, I also understand if some people prefer to merge it anyway. Warning-free compiles are important and useful in and by themselves.

  • Martin Storsjö added 12 commits

    added 12 commits

    • 4a4eeb39...b1d571f1 - 8 commits from branch videolan:master
    • 0301eb16 - Add casts to silence warnings about intended type conversions/shortenings
    • b2dd218b - obu: Initialize off_before_idx[0], fix MSVC warning about uninitialized use
    • 1679fe5f - meson: Try building with -Wshorten-64-to-32
    • 3bb47def - cdef_apply_tmpl: Restore the y variables to int

    Compare with previous version

  • Martin Storsjö resolved all discussions

    resolved all discussions

  • Martin Storsjö
    Martin Storsjö @mstorsjo started a thread on commit 0301eb16
  • 303 303 if ((unsigned) masks[0] == 1 && !(masks[1] >> 32)) {
    304 304 const int off = t->bx & (bs(&r[-b4_stride])[0] - 1);
    305 305 add_sample(-off, 0, 1, -1, &r[-b4_stride]);
    306 } else for (unsigned off = 0, xmask = masks[0]; np < 8 && xmask;) { // top
    306 } else for (unsigned off = 0, xmask = (uint32_t) masks[0]; np < 8 && xmask;) { // top
    • This was maybe the biggest surprise in the patchset. masks[0] is uint64_t and has got values set outside of the uint32_t range, but we intentionally need to only use the lowest half, otherwise this really doesn't work any longer.

      Therefore I used an (uint32_t) cast here, to indicate that we really explicitly want to truncate it to 32 bits (e.g. for completely hypothetical ABIs with a 64 bit int type).

    • I believe the second uint64_t has just one used bit, which for the first one is top/right and for the second one is top/left (or something like that). The first 32 bit are the regular top/left edges.

    • Please register or sign in to reply
  • mentioned in issue #242 (closed)

  • Martin Storsjö added 15 commits

    added 15 commits

    • 3bb47def...0d18b15a - 11 commits from branch videolan:master
    • 390489c7 - Add casts to silence warnings about intended type conversions/shortenings
    • ddb653e2 - obu: Initialize off_before_idx[0], fix MSVC warning about uninitialized use
    • 05a1267a - meson: Try building with -Wshorten-64-to-32
    • 5d3efc49 - cdef_apply_tmpl: Restore the y variables to int

    Compare with previous version

  • added 1 commit

    • 8872811e - cdef_apply_tmpl: Restore the y variables to int

    Compare with previous version

  • Martin Storsjö added 5 commits

    added 5 commits

    • 3cf4d32e - 1 commit from branch videolan:master
    • 13b7df8d - Add casts to silence warnings about intended type conversions/shortenings
    • baba5fc3 - obu: Initialize off_before_idx[0], fix MSVC warning about uninitialized use
    • fe17bd16 - cdef_apply_tmpl: Restore the y variables to int
    • ced01fec - meson: Try building with -Wshorten-64-to-32

    Compare with previous version

  • So, based on the discussion on irc, this should be acceptable. Who wants to merge it?

  • Ronald S. Bultje added 8 commits

    added 8 commits

    • ced01fec...4c21c931 - 4 commits from branch videolan:master
    • 35b1cde2 - Add casts to silence warnings about intended type conversions/shortenings
    • 65d963d4 - obu: Initialize off_before_idx[0], fix MSVC warning about uninitialized use
    • 703c72fd - cdef_apply_tmpl: Restore the y variables to int
    • 93ab93de - meson: Try building with -Wshorten-64-to-32

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading