SW500010 Microchip Technology, SW500010 Datasheet - Page 384

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
(347) external declaration inside function
A function contains an extern declaration. This is legal but is invariably not desirable as it restricts
the scope of the function declaration to the function body. This means that if the compiler encounters
another declaration, use or definition of the extern object later in the same file, it will no longer have
the earlier declaration and thus will be unable to check that the declarations are consistent. This
can lead to strange behaviour of your program or signature errors at link time. It will also hide any
previous declarations of the same thing, again subverting the compiler’s type checking. As a general
rule, always declare extern variables and functions outside any other functions. For example:
(348) auto variable "*" should not be qualified
An auto variable should not have qualifiers such as near or far associated with it. Its stor-
age class is implicitly defined by the stack organization. An auto variable may be qualified with
static, but it is then no longer auto.
(349) non-prototyped function declaration for "*"
A function has been declared using old-style (K&R) arguments. It is preferable to use prototype
declarations for all functions, e.g.:
This would be better written:
384
int input;
void process(int a)
{
int process(int a)
{
}
int process(input)
int input;
{
}
int input;
a = input;
/ * this would be better outside the function * /
extern int away;
return away + a;
/ * input has filescope * /
/ * local blockscope input * /
/ * this will use the local variable.
/ * warning flagged here * /
Is this right? * /
Error and Warning Messages
(Parser)
(Parser)
(Parser)

Related parts for SW500010