11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Error and Warning Messages(361) function declared implicit int (Parser)Where the compiler encounters a function call of a function whose name is presently undefined, thecompiler will automatically declare the function to be of type int, with unspecified (K&R style)parameters. If a definition of the function is subsequently encountered, it is possible that its typeand arguments will be different from the earlier implicit declaration, causing a compiler error. Thesolution is to ensure that all functions are defined or at least declared before use, preferably withprototyped parameters. If it is necessary to make a forward declaration of a function, it should bepreceded with the keywords extern or static as appropriate. For example:void set(long a, int b); /* I may prevent an error arising from calls below */void main(void){set(10L, 6); /* by here a prototype for set should have seen */}(362) redundant & applied to array (Parser)The address operator & has been applied to an array. Since using the name of an array gives itsaddress anyway, this is unnecessary and has been ignored, e.g.:int array[5];int * ip;ip = &array; /* array is a constant, not a variable; the & is redundant. */(364) attempt to modify * object (Parser)Objects declared const or code may not be assigned to or modified in any other way by yourprogram. The effect of attempting to modify such an object is compiler-specific.const int out = 1234; /* “out” is read only */out = 0; /* woops -- writing to a read-only object */(365) pointer to non-static object returned (Parser)This function returns a pointer to a non-static (e.g. auto) variable. This is likely to be an error,since the storage associated with automatic variables becomes invalid when the function returns,e.g.:274

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!