Skip to content

Turn on objc-nsinvocation-argument-lifetime clang-tidy warning in engine #116375

@jmagman

Description

@jmagman

objc-* clang-tidy warnings were turned on in flutter/engine#37813 but had to exclude objc-nsinvocation-argument-lifetime because of OCMock macros.
https://github.com/flutter/engine/blob/303e26e96561d9b76f2344e97a5fc32eb6dfdb9a/.clang-tidy#L11

❌ Failures for clang-tidy on /Volumes/Work/s/w/ir/cache/builder/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponderTest.mm:
/Volumes/Work/s/w/ir/cache/builder/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterChannelKeyResponderTest.mm:48:33: error: NSInvocation '-getArgument:atIndex:' should only pass pointers to objects with ownership __unsafe_unretained [objc-nsinvocation-argument-lifetime,-warnings-as-errors]
        [invocation getArgument:&message atIndex:2];
                                ^
../../third_party/ocmock/Source/OCMock/OCMStubRecorder.h:55:30: note: expanded from macro 'andDo'
#define andDo(aBlock) _andDo(aBlock)

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8796856828802754401/+/u/test:_lint_host_debug/stdout

Suppress the warnings in these places, and turn the clang-tidy check back on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.engineflutter/engine repository. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions