User forums > Using Code::Blocks
Code completion problem with #define
(1/1)
Quiss:
Hi,
I've encountered a problem with the code below:
--- Code: ---#define GPIOA_BaseAddress 0x5000
#define GPIOA ((GPIO_TypeDef *) GPIOA_BaseAddress)
typedef struct GPIO_struct
{
vu8 ODR; /*!< Output Data Register */
vu8 IDR; /*!< Input Data Register */
vu8 DDR; /*!< Data Direction Register */
vu8 CR1; /*!< Configuration Register 1 */
vu8 CR2; /*!< Configuration Register 2 */
}
GPIO_TypeDef;
void main()
{
for(;;)
{
(*(GPIO_TypeDef *) GPIOA_BaseAddress)-> // at this point, i can see structure member list
GPIOA-> // no CC when i use #define
}
}
--- End code ---
I'm using CB with default settings, am i missing something here? (CB: svn build rev 7550, OS: Windows 7 32 bit)
ollydbg:
That's because CC does not do macro expansion on every identifier. (This takes a lot of time, as it does not have a full preprocessor)
Navigation
[0] Message Index
Go to full version