Blob Blame History Raw
.TH MCPP "1" "Mar 2008" "alternative CPP" "User Commands"
.SH NAME
mcpp \- Matsui CPP, an alternative C preprocessor
.SH SYNOPSIS
mcpp [\fIoptions\fP] [\fI<infile>\fP [\fI<outfile>\fP]]
.SH DESCRIPTION
\fBmcpp\fR is a C/C++ preprocessor with the highest conformance which implements C90, C99 and C++98. 
\fBmcpp\fR has plentiful diagnostics and many #pragmas. 
It is useful to check portability of your program, and also useful to debug complicated macro.
This is a man-page for \fBmcpp\fR of compiler-independent-build.
.SH OPTIONS
\fBmcpp\fR expects two file names as arguments, \fI<infile>\fR and
\&\fI<outfile>\fR.  If not specified, \fI<infile>\fR defaults to standard input
and \fI<outfile>\fR defaults to standard output.
.PP
It takes the following options.
.PP
Commonly used options:
.IP \fB-@MODE
Specify preprocessing mode. MODE should be one of these 4:
.IP "    \fB-@std"
Standard conforming mode. (default)
.IP "    \fB-@poststd, -@post"
special 'post-Standard' mode.
.IP "    \fB-@kr"
K&R 1st mode.
.IP "    \fB-@oldprep, -@old"
"old_preprocessor" mode (i.e. "Reiser model" cpp).
.IP "    \fB-@compat"
Standard 'compatible' mode.
.IP \fB-C
Output also comments.
.IP "\fB-D <macro>[=<value>]"
Define <macro> as <value> (default:1).
.IP "\fB-D <macro(args)>[=<replace>]"
Define <macro(args)> as <replace>.
.IP "\fB-e <encoding>"
Change the default multi-byte character encoding to one of:
euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.
.IP "\fB-I <directory>"
Add <directory> to the #include search list.
.IP \fB-I-
Unset system or site specific include directories.
.IP \fB-j
Do not output the source line in diagnostics.
.IP \fB-k
Keep white spaces of input lines as they are.
.IP "\fB-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file"
Output source file dependency line for makefile.
.IP \fB-m32
Change target CPU from x86_64, ppc64 to i386, ppc, respectively.
.IP \fB-m64
Change target CPU from i386, ppc to x86_64, ppc64, respectively.
.IP \fB-[no-]mmx
(Un-)define __MMX__.
.IP \fB-N
Don't predefine any non-standard macros.
.IP "\fB-o <file>"
Output to <file>.
.IP \fB-P
Don't output #line lines.
.IP \fB-Q
Output diagnostics to "mcpp.err" (default:stderr).
.IP "\fB-U <macro>"
Undefine <macro>.
.IP \fB-v
Show version of \fBmcpp\fR.
.IP "\fB-W <level>"
Set warning level to <level> (OR of {0,1,2,4,8,16}, default:1).
.IP \fB-z
Don't output the included file, only defining macros.
.PP
Options available with -@std (default) or -@poststd options:
.IP \fB-+
Process C++ source.
.IP \fB-2
Enable digraphs.
.IP "\fB-h <n>"
Re-define the pre-defined macro __STDC_HOSTED__ as <n>.
.IP "\fB-S <n>"
Redefine __STDC__ to <n>, undefine old style macros.
.IP "\fB-V <n>"
Redefine __STDC_VERSION__ or __cplusplus to <n>.
.br
C with -V199901L specifies C99 mode.
.br
C++ with -V199901L specifies C99 compatible mode.
.PP
Options available with only -@std (default) option:
.IP \fB-@compat
Expand recursive macro more than Standard.
.IP \fB-3
Enable trigraphs.
.IP \fB-K
Embed macro annotations into comments.
.PP
Options available with -@std (default), -@kr or -@oldprep options:
.IP \fB-a
Process "assembler" source.
.SH PRAGMA
\fBmcpp\fR has the following #pragma directives.
.IP "#pragma once"
Read the header file only once even if multiply #included.
.IP "#pragma __setlocale( ""encoding"")"
Specify the multibyte character encoding to "encoding".
See -e option for the encodings.
.IP "#pragma MCPP put_defines"
Putout all the macro definitions currently valid.
.IP "#pragma MCPP debug <args>"
Start to putout debugging informations.
    <args> should be one or more of:
    token expand macro_call path if expression memory getc
.IP "#pragma MCPP end_debug <args>"
Stop to putout debugging informations.
    <args> are the same with 'debug'.
    No argument specifies all arguments.
.IP "#pragma MCPP push_macro( ""MACRO"")"
Save the macro definition to the stack.
.IP "#pragma MCPP pop_macro( ""MACRO"")"
Retrieve the macro definition from the stack.
.IP "#pragma MCPP preprocess"
"Pre-preprocess" the following header files for \fBmcpp\fR.
.IP "#pragma MCPP warning    any message"
Putout warning "any message".
.SH "VERSION"
MCPP V.2.7 (2008/03) compiler-independent-build
.SH "SEE ALSO"
Do 'man mcpp-gcc' for \fBmcpp\fR of GCC-specific-build.
The full documentation for \fBmcpp\fR are maintained as html files.
Please see mcpp-manual.html.