In our project, often use a lot of third-party code, the code may be very complex, we do not dare to change them, but the author has stopped updating, when the SDK upgrade or the compiler upgrade, these legacy code may appear many warnings, then we have no way to remove these annoying warnings, Or a project hundreds of warnings, how do we get rid of the warning?
, for third parties, we certainly do not want to change it, especially some update very frequent third parties, the general warning appears shortly after the author is updated, we do this in this operation, it seems wasteful. And when adding arm64 support, there are hundreds of types of warnings, It's quite time-consuming to change.
1: Closes a warning for a specified type of a specified file
Click Target-build phases-comlile sources to locate the corresponding file, and then add-wno-shorten-64-to-32
2: Using the compiler-provided macros to operate, this way in our project will be a lot of see
#pragma clang diagnostic push #pragma clang diagnostic ignored"-wdeprecated-declarations" //write in the middle of the code, will not be prompted by the compiler-wdeprecated-declarations types of warnings
#pragma clang diagnostic pop
IOS when using third-party files, warning implicit conversion loses integer precision: ' Long ' to ' int '