cpp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 04 Dec 2010 17:10:45 +0200
changeset 735 5c437e2d5fe1
parent 176 5181378e42af
child 839 ed02eb6c7a86
permissions -rw-r--r--
Fix Emacs settings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
735
5c437e2d5fe1 Fix Emacs settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 176
diff changeset
     1
-*- mode: outline; coding: utf-8; fill-column: 80 -*-
176
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     2
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     3
* How to see macros expansion?
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     4
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     5
** GCC.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     6
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     7
  $ cpp <file>.c
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     8
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
     9
** MSVC.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    10
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    11
  $ cl /E <file>.c
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    12
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    13
* Who to see predefined macros?
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    14
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    15
See
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    16
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    17
  http://predef.sourceforge.net/
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    18
  http://en.wikipedia.org/wiki/C_preprocessor#Compiler-specific_predefined_macros
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    19
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    20
** GNU C Compiler.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    21
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    22
  $ gcc -dM -E - < /dev/null
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    23
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    24
** HP-UX ansi C compiler.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    25
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    26
  $ cc -v EMPTY.c
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    27
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    28
** SCO OpenServer C compiler.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    29
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    30
  $ cc -## EMPTY.c
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    31
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    32
** Sun Studio C/C++ compiler.
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    33
5181378e42af CR/LF ==> LF.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 170
diff changeset
    34
  $ cc -## EMPTY.c