cpp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 14 Sep 2011 14:27:10 +0300
changeset 991 c3c2dfe7aa59
parent 899 7b4265c8d324
permissions -rw-r--r--
Small fix.

-*- mode: outline; coding: utf-8; -*-

* 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