• Jeremy Huddleston's avatar
    Silence clang static analysis warnings for SetReqLen · c19cda6d
    Jeremy Huddleston authored
    This provides a simplified version of the SetReqLen macro when using clang for
    static analysis.  Prior to this change, we would see many Idempotent operation
    warnings inside this macro due to the common case of calling with arg2 and
    arg3 being the same variable.  This has no effect on code produced during
    compilation, but it silences a number of false positives in static analysis.
    
    XIPassiveGrab.c:170:5: warning: Assigned value is always the same as the existing value
        SetReqLen(req, num_modifiers, num_modifiers);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from XIPassiveGrab.c:26:
    .../nx-X11/lib/X11/Xlibint.h:580:8: note: instantiated from:
                n = badlen; \
                  ^
    Signed-off-by: 's avatarJeremy Huddleston <jeremyhu@apple.com>
    Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
    c19cda6d
Xlibint.h 38.9 KB