Clang: Difference between revisions

From miki
Jump to navigation Jump to search
Line 4: Line 4:


* https://github.com/mstorsjo/llvm-mingw
* https://github.com/mstorsjo/llvm-mingw
: The best port of LLVM/Clang on Windows I tried. Does not require Visual Studio for linking. Support UBSAN (at least 64-bit target).
: 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

Revision as of 00:04, 18 November 2019

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!