1MCPP(1) User Commands MCPP(1)
2
3
4
6 mcpp - Matsui CPP, an alternative C preprocessor
7
9 mcpp [options] [<infile> [<outfile>]]
10
12 mcpp is a C/C++ preprocessor with the highest conformance which imple‐
13 ments C90, C99 and C++98. mcpp has plentiful diagnostics and many
14 #pragmas. It is useful to check portability of your program, and also
15 useful to debug complicated macro. This is a man-page for mcpp of com‐
16 piler-independent-build.
17
19 mcpp expects two file names as arguments, <infile> and <outfile>. If
20 not specified, <infile> defaults to standard input and <outfile>
21 defaults to standard output.
22
23 It takes the following options.
24
25 Commonly used options:
26
27 -@MODE Specify preprocessing mode. MODE should be one of these 4:
28
29 -@std
30 Standard conforming mode. (default)
31
32 -@poststd, -@post
33 special 'post-Standard' mode.
34
35 -@kr
36 K&R 1st mode.
37
38 -@oldprep, -@old
39 "old_preprocessor" mode (i.e. "Reiser model" cpp).
40
41 -C Output also comments.
42
43 -D <macro>[=<value>]
44 Define <macro> as <value> (default:1).
45
46 -D <macro(args)>[=<replace>]
47 Define <macro(args)> as <replace>.
48
49 -e <encoding>
50 Change the default multi-byte character encoding to one of:
51 euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.
52
53 -I <directory>
54 Add <directory> to the #include search list.
55
56 -I- Unset system or site specific include directories.
57
58 -j Do not output the source line in diagnostics.
59
60 -M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file
61 Output source file dependency line for makefile.
62
63 -N Don't predefine any non-standard macros.
64
65 -o <file>
66 Output to <file>.
67
68 -P Don't output #line lines.
69
70 -Q Output diagnostics to "mcpp.err" (default:stderr).
71
72 -U <macro>
73 Undefine <macro>.
74
75 -v Show version of mcpp.
76
77 -W <level>
78 Set warning level to <level> (OR of {0,1,2,4,8,16}, default:1).
79
80 -z Don't output the included file, only defining macros.
81
82 Options available with -@std (default) or -@poststd options:
83
84 -+ Process C++ source.
85
86 -2 Enable digraphs.
87
88 -h <n> Re-define the pre-defined macro __STDC_HOSTED__ as <n>.
89
90 -S <n> Redefine __STDC__ to <n>, undefine old style macros.
91
92 -V <n> Redefine __STDC_VERSION__ or __cplusplus to <n>.
93 C with -V199901L specifies C99 mode.
94 C++ with -V199901L specifies C99 compatible mode.
95
96 Options available with only -@std (default) option:
97
98 -@compat
99 Expand recursive macro more than Standard.
100
101 -3 Enable trigraphs.
102
103 -K Embed macro annotations into comments.
104
105 Options available with -@std (default), -@kr or -@oldprep options:
106
107 -a Process "assembler" source.
108
110 mcpp has the following #pragma directives.
111
112 #pragma once
113 Read the header file only once even if multiply #included.
114
115 #pragma __setlocale( "encoding")
116 Specify the multibyte character encoding to "encoding". See -e
117 option for the encodings.
118
119 #pragma MCPP put_defines
120 Putout all the macro definitions currently valid.
121
122 #pragma MCPP debug <args>
123 Start to putout debugging informations.
124 <args> should be one or more of:
125 token expand macro_call path if expression memory getc
126
127 #pragma MCPP end_debug <args>
128 Stop to putout debugging informations.
129 <args> are the same with 'debug'.
130 No argument specifies all arguments.
131
132 #pragma MCPP push_macro( "MACRO")
133 Save the macro definition to the stack.
134
135 #pragma MCPP pop_macro( "MACRO")
136 Retrieve the macro definition from the stack.
137
138 #pragma MCPP preprocess
139 "Pre-preprocess" the following header files for mcpp.
140
141 #pragma MCPP warning any message
142 Putout warning "any message".
143
145 MCPP V.2.7 (2008/03) compiler-independent-build
146
148 Do 'man mcpp-gcc' for mcpp of GCC-specific-build. The full documenta‐
149 tion for mcpp are maintained as html files. Please see mcpp-man‐
150 ual.html.
151
152
153
154alternative CPP Mar 2008 MCPP(1)