Clang

From miki
Jump to navigation Jump to search

Links

Clang on Windows

The best port of LLVM/Clang on Windows I tried. Does not require Visual Studio for linking. Support UBSAN (for 32-bit and 64-bit targets).
  • MSYS2
MSYS2 now provides clang 9.0 packages. No deps on VS but they don't provide UBSAN apparently.

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!