User`s guide

Including M-File Information in Compiler Output
5-37
Include #line Directives
To include #line directives in your generated C or C++ code, use
mcc -A line:on …
The Hello, World example produces the following code segment when this
option is selected.
In this example, Line 1 points to lines in the generated C code that were
produced by line 1 from the M-file, that is
function hello
Line 5 points to lines in the C code that were produced by line 5 of the M-file, or
fprintf(1,'Hello, World\n' );
.
#line 1 "<matlab>\\extern\\examples\\compiler\\hello.m"
static void Mhello(void) {
#line 1 "<matlab>\\extern\\examples\\compiler\\hello.m"
mxArray * ans = mclGetUninitializedArray();
/*
* % This is the hello, world function written in M code
* % $Revision: 1.1 $
* %
* fprintf(1,'Hello, World\n' );
*/
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mclAssignAns(
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
&ans,
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mlfNFprintf(0, mlfScalar(1), mxCreateString("Hello, World\\n"), NULL));
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
mxDestroyArray(ans);
#line 5 "<matlab>\\extern\\examples\\compiler\\hello.m"
}
.
.
.
Line 1
Line 1
Line 5
Line 5
Line 5
Line 5
Line 5