mcpp (1) - Linux Manuals

mcpp: Matsui CPP, an alternative C preprocessor

NAME

mcpp - Matsui CPP, an alternative C preprocessor

SYNOPSIS

mcpp [options] [<infile> [<outfile>]]

DESCRIPTION

mcpp is a C/C++ preprocessor with the highest conformance which implements C90, C99 and C++98. mcpp 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 mcpp of GCC-specific-build.

OPTIONS

mcpp expects two file names as arguments, <infile> and <outfile>. If not specified, <infile> defaults to standard input and <outfile> defaults to standard output.

It takes the following options.

Commonly used options:

-$, -fno-dollars-in-identifiers
Forbid '$' in identifiers.
-@MODE
Specify preprocessing mode. MODE should be one of these 4:
-@std
Standard conforming mode. (default)
-@poststd, -@post
special 'post-Standard' mode.
-@kr
K&R 1st mode.
-@oldprep, -@old
"old_preprocessor" mode (i.e. "Reiser model" cpp).
-@compat
Standard 'compatible' mode.
-b
Output #line lines in C source style (default: GCC style).
-C
Output also comments.
-D <macro>[=<value>]
Define <macro> as <value> (default:1).
-D <macro(args)>[=<replace>]
Define <macro(args)> as <replace>.
-dM, -dD
Dump all current macro definitions to output stream.
-e <encoding>
Change the default multi-byte character encoding to one of: euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.
-finput-charset=<encoding>
Same as -e <encoding>. (Do not insert spaces around '=').
-f[no-]working-directory
(Don't) emit #line marks with current working directory.
-fstack-protector[-all]
Add defines for GCC stack protector.
-f[no-]exceptions
(Don't) add define for exception support.
-fpic, -fPIC, -fpie, -fPIE
Add defines for PIC/PIE code.
-I <directory>
Add <directory> to the #include search list.
-I-
Unset system or site specific include directories.
-include <file>
Include the <file> prior to the main input file.
-isystem <dir>
Look for include files in DIR, if not found in -I's.
-iquote <dir>
Look for #include "file" (with quotes) in DIR.
-j
Do not output the source line in diagnostics.
-k
Keep white spaces of input lines as they are.
-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file
Output source file dependency line for makefile.
-m32
Change target CPU from x86_64, ppc64 to i386, ppc, respectively.
-m64
Change target CPU from i386, ppc to x86_64, ppc64, respectively.
-[no-]mmx
(Un-)define __MMX__.
-N
Don't predefine any non-standard macros.
-nostdinc
Unset system or site specific include directories.
-o <file>
Output to <file>.
-P
Don't output #line lines.
-Q
Output diagnostics to "mcpp.err" (default:stderr).
-U <macro>
Undefine <macro>.
-undef
Same as -N.
-v
Show version of mcpp.
-W <level>
Set warning level to <level> (OR of {0,1,2,4,8,16}, default:1).
-w
Same as -W0.
-z
Don't output the included file, only defining macros.

Options available with -@std (default) or -@poststd options:

-+
Process C++ source.
-2
Enable digraphs.
-digraphs
Enable digraphs.
-h <n>
Re-define the pre-defined macro __STDC_HOSTED__ as <n>.
-lang-c89
Same as -S1.
-lang-c99, -lang-c9x
Same as -S199901L.
-lang-c++
Same as -+.
-lang-asm
Same as -a.
-pedantic, -pedantic-errors
Same as -W7.
-S <n>
Redefine __STDC__ to <n>, undefine old style macros.
-std=<STANDARD>
Specify the standard to which the code should conform. <STANDARD> may be one of: c90, c99, iso9899:1990, iso14882, etc.
iso9899:<n>, iso14882:<n> : Same as -V <n> (long in decimals).
-V <n>
Redefine __STDC_VERSION__ or __cplusplus to <n>.
C with -V199901L specifies C99 mode.
C++ with -V199901L specifies C99 compatible mode.
-x c++
Same as -+.

Options available with only -@std (default) option:

-@compat
Expand recursive macro more than Standard.
-3
Enable trigraphs.
-trigraphs
Enable trigraphs.
-K
Embed macro annotations into comments.

Options available with -@std (default), -@kr or -@oldprep options:

-lang-asm
Same as -x assembler-with-cpp.
-x assembler-with-cpp
Process "assembler" source.

Option available on Mac OS X / Apple-GCC:

-arch <arch>
Change the target to <arch> (one of i386, x86_64, ppc and ppc64).

Option available on CygWIN:

-mno-cygwin
Change include directory and predefined macros for msvcrt.dll rather than cygwin1.dll.

PRAGMA

mcpp has the following #pragma directives.
#pragma once
Read the header file only once even if multiply #included.
#pragma __setlocale( "encoding")
Specify the multibyte character encoding to "encoding". See -e option for the encodings.
#pragma MCPP put_defines
Putout all the macro definitions currently valid.
#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
#pragma MCPP end_debug <args>
Stop to putout debugging informations.
 <args> are the same with 'debug'.
 No argument specifies all arguments.
#pragma MCPP push_macro( "MACRO")
Save the macro definition to the stack.
#pragma MCPP pop_macro( "MACRO")
Retrieve the macro definition from the stack.
#pragma MCPP preprocess
"Pre-preprocess" the following header files for mcpp.
#pragma MCPP warning any message
Putout warning "any message".

VERSION

MCPP V.2.7 (2008/03) for GCC

SEE ALSO

The full documentation for mcpp are maintained as html files. Please see mcpp-manual.html.