
86
Compiler
© 2008 Conrad Electronic
Example
Line number, file name and function name will be issued. Since file names may become quite long it
is recommended to dimension character arrays somewhat generous.
char txt[
60
];
txt=__LINE__;
Msg_WriteText(txt);
// Issue Line Number
Msg_WriteChar(
13
);
// LF
txt=__FILE__;
Msg_WriteText(txt);
// Issue File Number
Msg_WriteChar(
13
);
// LF
txt=__FUNCTION__;
Msg_WriteText(txt);
// Issue Function Name
Msg_WriteChar(
13
);
// LF
5.1.3
Pragma Instructions
By use of the
#pragma
instruction output and flow of the Compiler can be controlled. The following
commands are authorized:
#pragma Error "xyz..."
An error is created and text "xyz..." is issued
#pragma Warning "xyz..."
A warning is created and text "xyz..." is issued
#pragma Message "xyz..."
The text "xyz..." is issued by the Compiler
Example
These #pragma instructions are often used in conjunction with
commands and
. A classical example is the creation of an error message in case specific
hardware criteria are not met.
#ifdef MEGA128
#pragma Error
"Counter Functions not with Timer0 and Mega128"
#endif
5.1.4
Map File
If during compilation a Map File has been generated then the memory size of the used variable can
there be ascertained.
Example
The project CNT0.cprj generates the following Map File during compilation:
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......