cpp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 18 Jun 2011 11:06:41 +0300 (2011-06-18)
changeset 880 60bfe3e287eb
parent 840 c7002e98c1d5
child 899 7b4265c8d324
permissions -rw-r--r--
Funny Emacs modes.
-*- mode: outline; coding: utf-8; fill-column: 80 -*-

* How to see macros expansion?

** GCC.

  $ cpp <file>.c

** MSVC.

  $ cl /E <file>.c

* Who to see predefined macros?

See

  http://predef.sourceforge.net/
  http://en.wikipedia.org/wiki/C_preprocessor#Compiler-specific_predefined_macros

** GNU C Compiler.

  $ gcc -dM -E - < /dev/null

** HP-UX ansi C compiler.

  $ cc -v EMPTY.c

** SCO OpenServer C compiler.

  $ cc -## EMPTY.c

** Sun Studio C/C++ compiler.

  $ cc -## EMPTY.c

** IBM AIX XL C/C++ compiler.

  $ cc -qshowmacros -E EMPTY.c

** Visual Studio compiler.

  http://msdn.microsoft.com/en-us/library/b0084kay.aspx
                Predefined Macros