MCPP(1)

πŸ’– MCPP(1) β€” Matsui CPP, an alternative C preprocessor πŸ’–

πŸ¦‹ NAME πŸ¦‹

Okay bestie, meet mcpp β€” Matsui CPP, an alternative C preprocessor. πŸ’…


πŸ’» SYNOPSIS πŸ’»

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

🌸 DESCRIPTION 🌸

mcpp is a C/C++ preprocessor with the highest conformance, and it implements C90, C99 and C++98. It has plentiful diagnostics and many #pragmas. It is useful to check portability of your program, and it’s also useful to debug a complicated macro. This is a man-page for mcpp of compiler-independent-build. ✨


✨ OPTIONS ✨

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

It takes the following options.

🌟 Commonly used options 🌟

  • -@MODE β€” specify the 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.
yes bestie, it says 4 and then lists five β€” we are not editing the sacred text πŸ’€
  • -C β€” output also comments.
  • -D <macro>[=<value>] β€” define <macro> as <value> (default:1).
  • -D <macro(args)>[=<replace>] β€” define <macro(args)> as <replace>.
  • -e <encoding> β€” change the default multi-byte character encoding to one of: euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.
  • -I <directory> β€” add <directory> to the #include search list.
  • -I- β€” unset system or site specific include directories.
  • -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.
  • -o <file> β€” output to <file>.
  • -P β€” don't output #line lines.
  • -Q β€” output diagnostics to "mcpp.err" (default:stderr).
  • -U <macro> β€” undefine <macro>.
  • -v β€” show version of mcpp.
  • -W <level> β€” set warning level to <level> (OR of {0,1,2,4,8,16}, default:1).
  • -z β€” don't output the included file, only defining macros.

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

  • -+ β€” process C++ source.
  • -2 β€” enable digraphs.
  • -h <n> β€” re-define the pre-defined macro __STDC_HOSTED__ as <n>.
  • -S <n> β€” redefine __STDC__ to <n>, undefine old style macros.
  • -V <n> β€” redefine __STDC_VERSION__ or __cplusplus to <n>. C with -V199901L specifies C99 mode. C++ with -V199901L specifies C99 compatible mode.

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

  • -@compat β€” expand recursive macro more than Standard.
  • -3 β€” enable trigraphs.
  • -K β€” embed macro annotations into comments.

πŸ“ Options available with -@std (default), -@kr or -@oldprep options πŸ“

  • -a β€” process "assembler" source.

πŸͺ„ 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) compiler-independent-build

πŸ”Ž SEE ALSO πŸ”Ž

Do man mcpp-gcc for mcpp of GCC-specific-build. The full documentation for mcpp are maintained as html files. Please see mcpp-manual.html. πŸ’œ


with love from alternative CPP Β· Mar 2008 Β· page MCPP(1) β€” version MCPP V.2.7 (2008/03) compiler-independent-build πŸ’–βœ¨

πŸ“¦ where this page comes from