Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 396
 2012 Microchip Technology Inc.
(262) struct/union "*" redefined 
(Parser)
A structure or union has been defined more than once, for example:
struct {
  int a;
} ms;
struct {
  int a;
} ms;    /* was this meant to be the same name as above? */
(263) members can’t be functions 
(Parser)
A member of a structure or a union may not be a function. It may be a pointer to a func-
tion, for example:
struct {
  int a;
  int get(int);  /* should be a pointer: int (*get)(int); */
} object;
(264) bad bitfield type 
(Parser)
A bit-field may only have a type of int (or unsigned), for example:
struct FREG {
  char b0:1;   /* these must be part of an int, not char */
  char   :6;
  char b7:1;
} freg;
(265) integer constant expected 
(Parser)
colon appearing after a member name in a structure declaration indicates that the 
member is a bit-field. An integral constant must appear after the colon to define the 
number of bits in the bit-field, for example:
struct {
  unsigned first:  /* oops -- should be: unsigned first; */
  unsigned second;
} my_struct;
If this was meant to be a structure with bit-fields, then the following illustrates an 
example:
struct {
  unsigned first : 4;  /* 4 bits wide */
  unsigned second: 4;  /* another 4 bits */
} my_struct;
(266) storage class illegal 
(Parser)
A structure or union member may not be given a storage class. Its storage class is 
determined by the storage class of the structure, for example:
struct {
  /* no additional qualifiers may be present with members */
  static int first; 
} ;