I have been programming in C for many years, but I have just started using GCC/Eclipse for a new project to develop a product using an embedded ARM processor. I have found a problem that hasn't existed in previous C compilers I have used:
I have created a define as follows:
#define SWS pRCC->CFGR, B2+B3, 2
#define ReadPeriph(Address, Bits, Shift) ((Address & (Bits)) >> Shift)
If in my code I insert two lines:
x8 = ReadPeriph(sRCC->CFGR, B2+B3, 2);
y8 = ReadPeriph(SWS);
I would expect both lines to compile correctly and give the same result. However, although the first line is OK, the compiler generates an errors on the second saying "Multiple markers at this line - 'ReadPeriph' undeclared (first use in this function)