cpp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 12 Oct 2011 01:50:26 +0300
changeset 1025 6d7c8cb191cd
parent 899 7b4265c8d324
permissions -rw-r--r--
Feature branch.

-*- 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