Found in the clang mailing list: Bear on Github
Can be used to generate a compile_commands.json from a compile
command such as make
$ bear -- make $ ls <files...> compile_commands.json
Watch the comments here: http://programmers.stackexchange.com/a/156723
gcc -O -c -g -Wa,-ahl=so.s so.c
And some interesting tools are available here: http://isocpp.org/blog/2013/01/online-c-compilers
If the list of defines (-DXXX) is available it’s possible to hide some ifdef with hide-ifdef-mode.
Following this method:
(setq hide-ifdef-define-alist '((linux HAVE_UNISTD_H)
(win HAVE_WINDOWS_H)))
;; or hit C-@ U in a buffer with `hide-ifdef-mode' enabled
(hide-ifdef-use-define-alist 'linux)