Question

I was looking for an example on how to config OCLint or how to get it running. I made a search but nothing. Here at Stack Overflow there are just 3 posts related, just naming the library and on google just the official OCLint.org

The oficial docs says:

[user@localhost ~]$ oclint -help
OVERVIEW: OCLint, a static code analysis tool for Objective-C and related languages

USAGE: oclint [options] <input files>

OPTIONS:
  -D <macro>               - Predefine the specified macro
  -F <directory>           - Add directory to framework include search path
  -I <directory>           - Add directory to include search path
  -R <directory>           - Add directory to rule loading path
  -arch <arch_name>        - Specify which architecture (e.g. ppc, i386, x86_64, armv7) the compilation 
                             should targets.
  -help                    - Display available options (-help-hidden for more)
  -include <file>          - Include file before parsing
  -isysroot <directory>    - Add directory to SYSTEM include search path
  -o <file>                - Write output to <file>
  -rc <paramemter>=<value> - Change the baheviour of rules
  -stats                   - Enable statistics output from program
  Choose report type:
    -text                  - Plain text report
    -html                  - HTML formatted report
  -version                 - Display the version of this program
  -x <value>               - Input language type

But I would like a better explanation about macro (-D), and which path to choose for -I, -F, -R and what should I point at. A code example as

$ oclint path/to/file.m -D something -I something -F something -R something

And the output expected from that would be great.

Was it helpful?

Solution

Basically you just give oclint whatever you give to your compiler.

Alternatively, you may want to try oclint-xcodebuild if you are not familiar with compiler flags. This is a Python script that extracts flags from your Xcode build log file. See the usage here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top