Clang: Difference between revisions

From miki
Jump to navigation Jump to search
(Created page with "== Tips == === Get Stack Pointer === Use this macro [http://clang-developers.42468.n3.nabble.com/A-new-builtin-builtin-stack-pointer-td4035683.html]: <source lang=c> #define...")
 
Line 14: Line 14:
[http://clang.llvm.org/docs/UsersManual.html#options-to-control-error-and-warning-messages From the manual]
[http://clang.llvm.org/docs/UsersManual.html#options-to-control-error-and-warning-messages From the manual]
-Wno-error=foo Turn warning “foo” into an warning even if -Werror is specified.
-Wno-error=foo Turn warning “foo” into an warning even if -Werror is specified.

=== Enable all warnings: <code>-Weverything</code> ===
<code>-Weverything</code> means enable all current and future warnings. See [http://amattn.com/p/better_apps_clang_weverything_or_wall_is_a_lie.html Better Apps with Clang's Weverything or Wall is a Lie!]

Revision as of 07:15, 5 December 2017

Tips

Get Stack Pointer

Use this macro [1]:

#define current_stack_pointer ({ \
        register unsigned long esp asm("esp"); \
        asm("" : "=r"(esp)); \
        esp; \
        })

Turn errors into warning

From the manual

-Wno-error=foo Turn warning “foo” into an warning even if -Werror is specified.

Enable all warnings: -Weverything

-Weverything means enable all current and future warnings. See Better Apps with Clang's Weverything or Wall is a Lie!