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(277) can’t mix proto and non-proto args (Parser)A function declaration can only have all prototyped arguments (i.e. with types inside the parentheses)or all K&R style args (i.e. only names inside the parentheses and the argument types in a declarationlist before the start of the function body), e.g.:int plus(int a, b) /* woops -- a is prototyped, b is not */int b;{return a + b;}(278) argument redeclared: * (Parser)The specified argument is declared more than once in the same argument list, e.g.int calc(int a, int a) /* you cannot have two parameters called “a” */(279) can’t initialize arg (Parser)A function argument can’t have an initialiser in a declaration. The initialisation of the argumenthappens when the function is called and a value is provided for the argument by the calling function,e.g.:extern int proc(int a = 9); /* woops -- a is initialized when proc is called */(280) can’t have array of functions (Parser)You can’t define an array of functions. You can however define an array of pointers to functions,e.g.:int * farray[](); /* woops -- should be: int (* farray[])(); */(281) functions can’t return functions (Parser)A function cannot return a function. It can return a function pointer. A function returning a pointerto a function could be declared like this: int (* (name()))(). Note the many parentheses that arenecessary to make the parts of the declaration bind correctly.259

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

Saved successfully!

Ooh no, something went wrong!