Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nik.edited.branch #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,30 @@ For example:

*TODO*


-
## Xcode project

1 - compiler options
*Proposal enable "Pedantic Warnings" to YES and use this line in "Other C flags"*
```objc
-fsanitize=address -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -fsanitize=enum -fsanitize=float-cast-overflow -fsanitize=float-divide-by-zero -fsanitize=integer-divide-by-zero -fsanitize=signed-integer-overflow -fsanitize=vla-bound -Werror=objc-protocol-property-synthesis -Werror=protocol -Werror=objc-missing-super-calls -Werror=incompatible-pointer-types -Werror=unused-member-function -Werror=missing-selector-name -Werror=deprecated-declarations -Werror=abstract-vbase-init -Werror=atomic-property-with-user-defined-accessor -Werror=incomplete-implementation -Wunreachable-code -ferror-limit=100 -Wno-gnu-statement-expression -Wno-gnu-conditional-omitted-operand -Wno-c99-extensions

```

details:
about sanitize - http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
//TODO: after stable -fsanitize=memory add it to list (BUT It is not possible to combine more than one of the -fsanitize=address, -fsanitize=thread, and -fsanitize=memory checkers in the same program. The -fsanitize=undefined checks can only be combined with -fsanitize=address)

about -Werror and -W - it have self described names ;)
-Wno for disable GNU C extensions warnings

Proposal for Objective-C++ project's:
```
-flto -fsanitize=cfi-cast-strict -fsanitize=cfi-derived-cast -fsanitize=cfi-unrelated-cast -fsanitize=cfi-nvcall -fsanitize=cfi-vcall -fsanitize=object-size -fsanitize=return -fsanitize=vptr -fsanitize-memory-use-after-dtor
```


2 - file structure
The physical files should be kept in sync with the Xcode project files in order to avoid file sprawl. Any Xcode groups created should be reflected by folders in the filesystem. Code should be grouped not only by type, but also by feature for greater clarity.

When possible, always turn on "Treat Warnings as Errors" in the target's Build Settings and enable as many [additional warnings](http://boredzo.org/blog/archives/2009-11-07/warnings) as possible. If you need to ignore a specific warning, use [Clang's pragma feature](http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas).
Expand Down