Skip to content

Commit a9b3d0b

Browse files
Saadnajmieschwieb
andauthored
fix(0.81): suppress warning around a constructor function (#2850)
Backport #2840 Co-authored-by: Erik Schwiebert <eriksc@microsoft.com>
1 parent 29539df commit a9b3d0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-native/React/Base/RCTBridgeModule.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ RCT_EXTERN_C_END
9191
{ \
9292
return @ #js_name; \
9393
} \
94+
_Pragma("clang diagnostic push") \
95+
_Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \
9496
__attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)(void) \
9597
{ \
9698
RCTRegisterModule([objc_name class]); \
97-
}
99+
} \
100+
_Pragma("clang diagnostic pop")
98101

99102
// Implemented by RCT_EXPORT_MODULE
100103
+ (NSString *)moduleName;

0 commit comments

Comments
 (0)