Permalink
Browse files

Fix format specifier used in RCTCxxMethod

Summary:
[`CxxModule::Method::callbacks`](https://github.com/facebook/react-native/blob/2161f92aaf37e126c6906e7ae6202d196b72648c/ReactCommon/cxxreact/CxxModule.h#L66) is `size_t` which uses `%zu` as the format specifier. Newer versions of clang can warn or error on this. This change prevents that from happening.

Local builds with clang 5.
Closes #15402

Differential Revision: D5583710

Pulled By: javache

fbshipit-source-id: 1d1e740c275fddfea177cf9476cd1d03b7e27330
  • Loading branch information...
kastiglione authored and facebook-github-bot committed Aug 8, 2017
1 parent d013ba3 commit 0e3117c9726bdd8c94bfe5c6933f5cb2c6dec414
Showing with 1 addition and 1 deletion.
  1. +1 −1 React/CxxModule/RCTCxxMethod.mm
@@ -66,7 +66,7 @@ - (id)invokeWithBridge:(RCTBridge *)bridge
CxxModule::Callback second;
if (arguments.count < _method->callbacks) {
RCTLogError(@"Method %@.%s expects at least %lu arguments, but got %tu",
RCTLogError(@"Method %@.%s expects at least %zu arguments, but got %tu",
RCTBridgeModuleNameForClass([module class]), _method->name.c_str(),
_method->callbacks, arguments.count);
return nil;

0 comments on commit 0e3117c

Please sign in to comment.