Clang

From miki
Jump to navigation Jump to search

Links

Clang on Windows

LLVM-MinGW

The best port of LLVM/Clang on Windows I tried.

  • No dependency on Visual Studio.
  • Support 32-bit and 64-bit targets.
  • Support sanitizers (ASAN, UBSAN).

MSYS2

MSYS2 now provides clang 9.0 packages.

  • No dependency on Visual Studio.
  • Support 32-bit and 64-bit targets.
  • But does not support sanitizers (ASAN, UBSAN).

Official LLVM

Packages from the official LLVM at http://releases.llvm.org/download.html.

  • DEPEND on Visual Studio for linking
  • Support 32-bit and 64-bit targets.
  • (Maybe) support sanitizers (ASAN, UBSAN).

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!