cpp.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 20 Jul 2011 10:54:41 +0300
changeset 899 7b4265c8d324
parent 840 c7002e98c1d5
permissions -rw-r--r--
Set fill-column as directory local var.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
899
7b4265c8d324 Set fill-column as directory local var.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 840
diff changeset
     1
-*- mode: outline; coding: utf-8; -*-
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
839
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    35
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    36
** IBM AIX XL C/C++ compiler.
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    37
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    38
  $ cc -qshowmacros -E EMPTY.c
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    39
840
c7002e98c1d5 Visual Studio compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 839
diff changeset
    40
** Visual Studio compiler.
839
ed02eb6c7a86 IBM AIX XL C/C++ compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    41
840
c7002e98c1d5 Visual Studio compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 839
diff changeset
    42
  http://msdn.microsoft.com/en-us/library/b0084kay.aspx
c7002e98c1d5 Visual Studio compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 839
diff changeset
    43
                Predefined Macros
c7002e98c1d5 Visual Studio compiler.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 839
diff changeset
    44