Thread: specifier-qualifier-list

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    specifier-qualifier-list

    Code:
    typedef struct s
    {
    int* true;
    int* false;
    int* next;
    int quad;
    char place[5];
    }ETYPE;
    
    typedef union
    {
    char id[10];
    ETYPE eval;
    } YYSTYPE;
    extern YYSTYPE yylval;
    This gives the error expected specifier-qualifier list before ETYPE

    and

    Code:
    typedef union
    {
    char id[10];
    struct ETYPE eval;
    } YYSTYPE;
    extern YYSTYPE yylval;
    gives the error: Field 'eval' has incomplete type

    Can someone give the correct syntax please?

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    The sure thing is:
    Code:
    typedef union
    {
    char id[10];
    struct s eval;
    } YYSTYPE;
    extern YYSTYPE yylval;
    Since struct ETYPE has no meaning, either struct s or just ETYPE

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    5
    Please switch over to this thread

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. instantiated from here: errors...
    By advocation in forum C++ Programming
    Replies: 5
    Last Post: 03-27-2005, 09:01 AM
  3. How can I traverse a huffman tree
    By carrja99 in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2003, 05:46 PM
  4. List class
    By SilasP in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2002, 05:20 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM