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

minmax: don't nest min/max in clamp to avoid -Wshadow warnings #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 9, 2021

  1. minmax: don't nest min/max in clamp to avoid -Wshadow warnings

    Using clamp from minmax.h with -Wshadow (GCC 11 and 8, haven't tested others)
    generates a bunch of warnings because min and max both declare _a, _b vars.
    Store the result of min to a temporary variable instead of nesting the calls
    this way min's variables are not in scope of max.
    
    Signed-off-by: Jakub Kicinski <[email protected]>
    kuba-moo committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    48936c0 View commit details
    Browse the repository at this point in the history