mpcc [options] filename
is used to compile an mpC program. The mpcc command processes an input file through one or more of three stages: preprocessing, analysis, and generation of one or two target C files. A standard C preprocessor is used for preprocessing. The most recommended C preprocessor is GNU cpp. Only one input file may be processed at once. The suffix .mpc is used for mpC source files, and the suffix .c is used for generated C files. mpcc puts the generated C files into the current directory.
All options must be separated. For example, option -hetmacro is quite different from -het -macro. All options different from those described below are considered preprocessor’s options.
Verbose mode. The compiler prints to standard output the compilation time (in seconds) and the version of the compiler. If a syntax error is detected, the compiler produces a message specifying the parser’s restart point.
Performs only the preprocessing stage.
Performs only the preprocessing and analyzing stages. Does not generate the target code.
Does not buffer messages, and prints a message immediately after the error is detected. If a syntax error is detected, the compiler will print some additional messages not printed in the default mode.
Evaluates constant subexpressions (default).
Does not evaluate constant subexpressions. This option is mainly useful if the generated code should be inspected. Some compile-time checks are not performed, and some errors are not detected in this mode.
This option specifies one of the four parser modes. <mode> may be SHORT, ANSI, LONG, and ALL. SHORT is the default mode. This mode only allows the short form of the mpC keywords. The LONG mode only allows the full form of the mpC keywords. The ALL mode allows both forms of the mpC keywords. The ANSI mode only allows the ANSI C keywords. For example,
While net and mpc_net are identifiers in the ANSI mode, they will be mpC keywords in the ALL mode;
net is an identifier in the LONG mode and an mpC keyword in the SHORT mode;
mpc_net is an identifier in the SHORT mode and an mpC keyword in the LONG mode.
This option supports incorporation of legacy C code into mpC applications.
Does not use RTS macros in the generated C code. The generated C code with macros is shorter but may be more difficult to understand.
Directs output of the mpC compiler to a standard output instead of the C file.
Generates two target C files. By default, for a source mpC file foo.mpc the compiler generates one C file, foo.c. Option -het makes the compiler generate two target C files: foo_host.c, containing the code for the host-process, and foo_node.c, containing the code for the other processes.
Does not print warnings.
Prints only the important warnings (default).
Prints all warnings, including:
Warnings about possible errors in declarations (-Wdecl, default).
Warnings about possibly incorrect data initialization (-Winit, default).
Warnings about operand sizes whose correctness cannot be checked at compile time (-Wsize).
Warnings about operand distributions whose correctness cannot be checked at compile time (-Wdistr, default).
Warnings regarding the location or usage of statements (-Wstats, default).
Warnings regarding the declaration or usage of labels (-Wlab).
Warnings regarding the declaration/usage of formal parameters, function arguments or network-type arguments (-Wargs).
A #pragma directive of the form
#pragma keywords <mode>:
has the same affect on the mpC keywords as option -k described above. It allows the application programmers to use the same header file in both C and mpC source files.