erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

[3.6] OCMVerify generates a warning for objc_method_family (init) methods #390

Closed dmaclach closed 4 years ago

dmaclach commented 4 years ago

This appears to be an clang issue however I thought folks should be aware of it here:

- (void)testFoo {
  id object;
  OCMVerify([object init]);
}

will generate a warning: "expression result unused" for any init type methods (of type objc_method_family (init))

The temporary workaround is to call _OCMVerify or _OCMVerifyWithQuantifier directly.

https://bugs.llvm.org/show_bug.cgi?id=45245

erikdoe commented 4 years ago

Please update if and when there are news from clang.

erikdoe commented 4 years ago

Fixed with 9b234bd131ccc264cce1bec447b502da7ac843c5. (Now we need to remember to remove this when the issue in clang gets fixed...)