CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Compiling Error131: Macro is defined recursively

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
norman_tan



Joined: 30 Jan 2008
Posts: 27

View user's profile Send private message

Compiling Error131: Macro is defined recursively
PostPosted: Tue Mar 13, 2018 1:48 am     Reply with quote

Hi All,
Has anybody ever met compiling Error131: Macro is defined recursively?
and how to solve this question if you met it before?

In my codes:
#define PBC_INT_DATA_ATTR

#define PBC_EXTERN_ATTR extern
or
#define PBC_EXTERN_ATTR


#define PBC_DATA pbc_data[handle].
//extern struct pbc_data PBC_INT_DATA_ATTR pbc_data[];

#else

#define PBC_DATA pbc_data.
//extern struct pbc_data PBC_INT_DATA_ATTR pbc_data;

#endif

and,

struct pbc_data
{
V1SL_SYS_PBC_DETAIL_PTR detail_ptr; /* detail-pointer of the related device */

V1SL_SYS_PTR_TYPE c0c1_sys_ptr; /* sys-pointer of the related device C0C1 */
V1SL_SYS_PTR_TYPE c2_sys_ptr; /* sys-pointer of the related device C2 */

V1SL_SYS_PATH_TYPE c0c1_sys_path; /* sys-path of related device C0C1 */
V1SL_SYS_PATH_TYPE c2_sys_path; /* sys-path of related device C2 */
...
}


Command line below will cause Error131 :"Micro is defined recursively" during compiling:

#ifdef V1SL_CFG_ENVIRONMENT_MULTI_DEVICE

PBC_EXTERN_ATTR struct pbc_data PBC_INT_DATA_ATTR pbc_data[PBC_DEVICE_NUMBER];

#else

PBC_EXTERN_ATTR struct pbc_data PBC_INT_DATA_ATTR pbc_data;
#endif

I do not know how to solve this error and ask help here.

Thanks a lot!

Norman
Ttelmah



Joined: 11 Mar 2010
Posts: 19510

View user's profile Send private message

PostPosted: Tue Mar 13, 2018 4:19 am     Reply with quote

pbc_data == PBC_DATA......

Unless you turn strict typing on, CCS runs with case significance turned off. You have a define called PBC_DATA, and a variable called pbc_data. Result two different things using the same name.....

So this:

#define PBC_DATA pbc_data[handle]

Is trying to define something in terms of itself. Hence 'recursive'.
norman_tan



Joined: 30 Jan 2008
Posts: 27

View user's profile Send private message

PostPosted: Wed Mar 14, 2018 12:29 am     Reply with quote

Hi Ttelmah,

CCS told me add command line "#case" at the start of the program will solve this problem!
I have tried it, CCS is right.

Thanks a lot!
Ttelmah



Joined: 11 Mar 2010
Posts: 19510

View user's profile Send private message

PostPosted: Wed Mar 14, 2018 2:08 am     Reply with quote

as I said: "turn strict typing on".

#device ANSI also forces this. Which you need is dependant on what you actually want to do...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group