Code Monkey home page Code Monkey logo

xcodewarnings's Introduction

XcodeWarnings

XcodeWarnings.xcconfig is an Xcode configuration file that lists all warnings and static analyzer settings present in Xcode 15. Comment out any settings that won't help your project.

Accompanying blog post: Xcode Warnings: Turn Them Up to Eleven!

All warnings are enabled, with these exceptions:

Commented Out by Default

  • "Pedantic Warnings" (GCC_WARN_PEDANTIC) isn't enabled because ordinary interaction with Apple's libraries makes it unhappy.
  • "Treat Warnings as Errors" (GCC_TREAT_WARNINGS_AS_ERRORS and SWIFT_TREAT_WARNINGS_AS_ERRORS) aren't enabled because when experimenting with code, I sometimes temporarily comment out a line which uses a variable โ€” which triggers the "Unused Variables" warning.
  • "Unused Parameters" (GCC_WARN_UNUSED_PARAMETER) isn't enabled because it's not unusual to provide a method required by Apple's frameworks that ignores a parameter.

Not Even Included

  • "Implicit Synthesized Properties" (CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS) isn't included because in all likelihood, you don't need to be backwards compatible with non-modern Objective-C.
  • "Disable Safety Checks" (SWIFT_DISABLE_SAFETY_CHECKS) isn't included in order to keep runtime safety checks when optimizing.
  • "Inhibit All Warnings" (Apple Clang) and "Suppress Warnings" (Swift) aren't included because they're the opposite of our goals for this configuration.

Static Analyzer

The Static Analyzer is also completely enabled, including "Deep" analysis during the Build action. If that's too slow, comment out CLANG_STATIC_ANALYZER_MODE to restore faster "Shallow" analysis.

Author

Jon Reid is the author of iOS Unit Testing by Example. His website is Quality Coding.

Mastodon Follow

xcodewarnings's People

Contributors

acecilia avatar darthmike avatar flashsheridan avatar jonreid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodewarnings's Issues

Open source extraction script?

Thanks a lot for this project, this is super useful ๐Ÿ‘

I was wondering how you extracted the variables names from Xcode, and if you would consider open-sourcing the script (if you're using one)?

Some missing warnings

Here are some warnings that are missing from the config file. I don't know the Xcode build setting names for any of these, just the Clang flags:

-Woverriding-method-mismatch    // Obj-C method override has different return type from super
-Weffc++                        // Warnings from the classic "Effective C++" book
-Wcall-to-pure-virtual-from-ctor-dtor   // Calling a pure virtual method from a ctor/dtor
-Wmemset-transposed-args        // Mixing up size and value args of memset()
-Wreturn-std-move               // Tricky case where returning triggers a copy w/o std::move()
-Wsizeof-pointer-div            // "sizeof(a) / sizeof(a[0])" where a is a pointer not an array
-Wdefaulted-function-deleted    // Can't default-construct this class

The first two have been around for years. The rest are apparently new in the version of Clang in Xcode 11. They were described in "What's New In Clang And LLVM" (WWDC '19).

In the absence of build-setting names, I've just been setting these by adding this line:

WARNING_CFLAGS = -Woverriding-method-mismatch -Weffc++ -Wcall-to-pure-virtual-from-ctor-dtor -Wmemset-transposed-args -Wreturn-std-move -Wsizeof-pointer-div -Wdefaulted-function-deleted

xcode 7

any plans to update this for xcode 7? i don't know as much as you as to how you look up available values of warnings, i'm interested in helping out if you show the way :)

Please include Pedantic Warnings, even if commented out

First, thanks very much, this is very cool. But I would suggest including GCC_WARN_PEDANTIC, even if commented out, so that people not including unpedantic libraries can try it. (It might also encourage maintainers to fix the problems.) Not urgent for me; including your file plus an override file seems simple enough.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.