Try Documentalist, my app that offers fast, offline access to 190+ programmer API docs.

  • sanitizers
    • address sanitizer (memory corruptions), 2x slowdown
      Compile with: -O1 -g -fsanitize=address -fno-omit-frame-pointer
      Add -fno-optimize-sibling-calls for better callstacks
      Link with: -g -fsanitize=address
      • testing sanitizer is enabled
        It's good to verify that sanitizer is enabled and working. Add this snippet of code and call it from your code. It should trigger sanitizer
        void trigger_address_sanitizer() {
          char *a = (char*)malloc(4);
          char c = a[5]; /* this line should trigger sanitizer */
          printf("c: %d\n", (int)c);
  • on mac
    brew install llvm installs latest version (currently 5.0).
    To not conflict with XCode, binaries are in /usr/local/Cellar/llvm/5.0.0/bin/` e..g. /usr/local/Cellar/llvm/5.0.0/bin/clang
  • misc - allows cross-compiling Windows code on Linux using clang wrapper - luajit bindings,,
    On mac:
    brew install llvm --with-clang --with-clang-extra-tool --with-compiler-rt --with-libcxx --with-lld --with-lld --with-python --with-rtti --with-utils --HEAD
    mkdir -p ~/Library/Python/2.7/lib/python/site-packages
    echo '/usr/local/opt/llvm/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
    LD_LIBRARY_PATH=/usr/local/opt/llvm/lib ~/src/pyclang/ draw_flood.c
    In each *.py tool:
        from clang.cindex import Config
    -stdlib=libc++  : use clang's C++ library (as opposed to OS's libstdc++)

Feedback about page:

Optional: your email if you want me to get back to you:

Share on        

Need fast, offline access to 190+ programmer API docs? Try my app Documentalist for Windows