another 'typedef struct' problem ?

This is a discussion on another 'typedef struct' problem ? within the C Programming forums, part of the General Programming Boards category; i am stumped over this part of the code they are as following : Code: typedef struct { V1SL_ENUM_C0_DEBUG_CODE debug_code; ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    3

    another 'typedef struct' problem ?

    i am stumped over this part of the code

    they are as following :

    Code:
    typedef struct
    {
        V1SL_ENUM_C0_DEBUG_CODE                 debug_code;
    
        Unsigned8                               detail_1;
        Unsigned8                               detail_2;
    
        #ifdef V1SL_CFG_ENVIRONMENT_MULTI_INSTANCE
    
        Unsigned8                               handle;
    
        #endif
    
    }   
    V1SL_STRUC_C0_DEBUG_BUFFER_ITEM;
    
    #define V1SL_INT_C0_DEBUG_BUFFER_ITEM_PTR   V1SL_STRUC_C0_DEBUG_BUFFER_ITEM V1SL_INT_DATA_ATTR * 
    
    
    /* C0: V1SL_STRUC_C0_ERRCB (_ERROR_DETAIL_PTR): */
    
    
    typedef struct
    {
        Unsigned16                             detail_1;
        Unsigned16                             detail_2;
        
        V1SL_INT_C0_DEBUG_BUFFER_ITEM_PTR      debug_buffer_ptr;
        Unsigned8                              debug_buffer_index;
    
    }	
    V1SL_STRUC_C0_ERRCB;
    
    #define V1SL_HUGE_C0_ERRCB_PTR             V1SL_STRUC_C0_ERRCB V1SL_DATA_ATTR_HUGE *
    this is part of a header file which is very long...

    the gmake 166 compiler return a error in line :

    V1SL_INT_C0_DEBUG_BUFFER_ITEM_PTR debug_buffer_ptr;

    it says that

    warning: no semicolon at end of struct or union & parse error before `*'

    it was confusing for me as i have checked with the previous typedef thread for the correct syntax.

    is it a problem with the different compiler to use, the original programmer have suggest to use a keil C51 compiler however my company have only gmake 166

    thanks in advance

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    3
    opps sorry folks

    I have found out that the main problem lies in the #define statement

    #define V1SL_INT_C0_DEBUG_BUFFER_ITEM_PTR V1SL_STRUC_C0_DEBUG_BUFFER_ITEM V1SL_INT_DATA_ATTR *

    but i have not idea how to make changes so the compiler can recognise it

    can anyone help me out with this ?

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    try putting the asterisk before the second param of the #define. not sure if that'll help....and those are some long constants!

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    3
    that was my problem all along, super long winded code

    well i have finally discover what is wrong with it

    thanks anyway !

    I shall be bothering you guys again later with more codes

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 06-04-2009, 02:03 PM
  2. pointer problem or so...
    By TL62 in forum C Programming
    Replies: 19
    Last Post: 01-12-2008, 10:45 PM
  3. Looking for a way to store listbox data
    By Welder in forum C Programming
    Replies: 20
    Last Post: 11-01-2007, 11:48 PM
  4. Problem with typedef struct
    By cprogrammer_18 in forum C Programming
    Replies: 2
    Last Post: 02-03-2006, 05:01 AM
  5. Somthing wrong with my typedef struct.
    By Queatrix in forum C++ Programming
    Replies: 9
    Last Post: 09-13-2005, 09:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21