Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル
製品コード
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 398
2012 Microchip Technology Inc.
(276) type specifier required for prototyped argument
(Parser)
A type specifier is required for a prototyped argument. It is not acceptable to just have
an identifier.
an identifier.
(277) can’t mix prototyped and non-prototyped arguments
(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 declaration list before the start of the function body), for example:
the parentheses) or all K&R style args (i.e., only names inside the parentheses and the
argument types in a declaration list before the start of the function body), for example:
int plus(int a, b) /* oops -- 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, for
example:
example:
/* can’t have two parameters called "a" */
int calc(int a, int a)
(279) initialization of function arguments is illegal
(Parser)
A function argument can’t have an initializer in a declaration. The initialization of the
argument happens when the function is called and a value is provided for the argument
by the calling function, for example:
argument happens when the function is called and a value is provided for the argument
by the calling function, for example:
/* oops -- a is initialized when proc is called */
extern int proc(int a = 9);
(280) arrays of functions are illegal
(Parser)
You cannot define an array of functions. You can; however, define an array of pointers
to functions, for example:
to functions, for example:
int * farray[](); /* oops -- 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 pointer to a function could be declared like this: int (* (name()))(). Note the many
parentheses that are necessary to make the parts of the declaration bind correctly.
a pointer to a function could be declared like this: int (* (name()))(). Note the many
parentheses that are necessary to make the parts of the declaration bind correctly.
(282) functions can’t return arrays
(Parser)
A function can return only a scalar (simple) type or a structure. It cannot return an array.
(283) dimension required
(Parser)
Only the most significant (i.e., the first) dimension in a multi-dimension array may not
be assigned a value. All succeeding dimensions must be present as a constant
expression, for example:
be assigned a value. All succeeding dimensions must be present as a constant
expression, for example:
/* This should be, for example: int arr[][7] */
int get_element(int arr[2][])
{
return array[1][6];
}
(284) invalid dimension
(Parser)
This is an internal compiler error. Contact Microchip Technical Support with details.