SW500011 Microchip Technology, SW500011 Datasheet - Page 34

HI-TECH X PRO FOR PIC32

SW500011

Manufacturer Part Number
SW500011
Description
HI-TECH X PRO FOR PIC32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheet

Specifications of SW500011

No. Of User Licenses
1
Supported Families
PIC32
Core Architecture
PIC
Supported Hosts
Windows XP, Vista, Linux, Mac OS X
Software Edition
Professional
Kit Contents
Software And Docs
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
032
778-1007
778-1007
Runtime Files
function for the project being compiled. After parsing, the p-code output derived from doprnt.c is
then combined with the remainder of the C program in the final code generation step.
If the format string in a call to printf is not a string literal as in the tutorial, but is rather a pointer
to a string, then the compiler will not be able to reliably predict the printf usage, and so it forces a
more complete version of printf to be generated. However, even without being able to scan printf
placeholders, the compiler can still make certain assumptions reagarding the usage of the function.
In particular, the compiler can look at the number and type of the additional arguments to printf
(those following the format string expression) to determine which placeholders could be valid. This
enables the size and complexity of the generated printf routine to be kept to a minimum.
34
T
C
printf(”input is: $d”);
The compiler will note that only the %d placeholder is used and the doprnt module that is
linked into the program will only contain code that handles printing of decimal integers.
The code is latter changed and another call to printf is added. The new call looks like:
printf(”output is %6d”);
Now the compiler will detect that in addition there must be code present in the doprnt
module that handles integers printed to a specific width. The code that handles this flag
will be introduced into the doprnt module.
The size of the doprnt module will increase as more printf features are detected.
T
P
printf in a program and it appears as in the following code:
the compiler cannot determine the exact format string, but can see that there are no
additional arguments to printf following the format string represented by mes. Thus,
the only valid format strings will not contain placeholders that print any arguments,
and a minimal version of printf will be generated and compiled. If the above code
was rewritten as:
UT RIAL
UT RIAL
RINTF WITHOUT LITERAL FORMAT STRINGS
ALLS TO PRINTF
void my_print(const char * mes) {
}
void my_print(const char * mes, double val) {
}
printf(mes);
printf(mes, val);
A program contains one call to printf, which looks like:
If there is only one reference to
PICC32 Command-line Driver

Related parts for SW500011