IOS when using third-party files, warning implicit conversion loses integer precision: ' Long ' to ' int '

Source: Internet
Author: User

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.