User`s guide

Formatting Compiler-Generated Code
5-29
Formatting Compiler-Generated Code
The f ormatting options allow you to control the l ook of the Compiler-generated
C or C++ code. These options let you set the width of the generated code and
the indentation levels for statements and expressions. To control code
formatting, use
-F <option>
The remaining sections focus on the different choices you can use.
Listing All Formatting Options
To view a list of all available formatting options, us e
mcc -F list …
Setting Page Width
Use the page-width:n option to set the maximum width of the generated code
to
n,aninteger. The default is80columnswide, sonotselecting any pagewidth
formatting option will automatically limit your columns to 80 characters.
Setting the page width to a desired value does not guarantee that all generated
lines of code will not exceed that value. There are cases where, due to
indentation perhaps, a variable name may not fit within the width limit. Since
variable names cannot be split, they may extend beyond the set limit. Also, to
maintain the syntactic integrity of the original M source,annotations included
from the M source file are not wrapped.
Note When using -A line:on, which is the default with the MATLAB add-in
for Visual Studio, the page width is set as large as possible to support
source-level debugging and this setting is ignored.
Default Width
Not s pecifying a page width formatting option uses t he default of 8 0. Using
mcc -x gasket
generates this code segment.