MATLAB COMPILER RELEASE NOTES User's Guide Page 150

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 149
5 Controlling Code Generation
5-34
Including M-File Information in Compiler Output
Theannotationoptionsallowyoutocontrolthetypeofannotationinthe
Compiler-generatedC orC++ code.Theseoptionsletyou includethecomments
and/or source code from the initial M-file(s) as well as
#line preprocessor
directives. Y ou ca n also use an annotation option to generate source file and
line numberinformationwhen youreceiverun-timeerrormessages.Tocontrol
code annotation, use
-A <option>
You can combine annotation o ptions, forexample selecting both comments and
#line directives. The remaining sections focus on the different choices you can
use.
Controlling Comments in Output Code
Use the annotation:type option to include your initial M-file comments and
code in your generated C or C++ output. The possible values for
type are:
all
comments
none
Not specifying any annotation type uses the default of all, which includes the
complete source of the M-file (comments and code) interleaved with the
generated C/C++ source.
The following sections show segments of the generated code from this simple
Hello, World example.
function hello
% This is the hello, world function written in M code
fprintf(1,'Hello, World\n' );
Comments Annotation
To include only comments from t he source M-file in the generated output, use
mcc -A annotation:comments …
This code snippet shows the generated code containing only the comments.
Page view 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 263 264

Comments to this Manuals

No comments