Clang

From miki
Revision as of 13:11, 22 December 2016 by Mip (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.