User`s guide
Formatting Compiler-Generated Code
5-35
Formatting Compiler-Generated Code
The formatting options allow you to control the look 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.
Note To improve the readability of your generated code, turn off
optimizations with
-O none or -g. The examples in this section have
optimizations off.
Listing All Formatting Options
To view a list of all available formatting options, use
mcc -F list
Setting Page Width
Use the page-width:n option to set the maximum width of the generated code
to
n, an integer. The default is 80 columns wide, so not selecting any page width
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.