IAR Compiler warning: "macro does not create a valid token"
<p><strong>I have written the following macro in C:</strong></p>

<pre><code>#define __HAL_CLK_ENABLE(CONTROL_STRUCT,REG,CLK) do { \
SET_BIT(CONTROL_STRUCT-&gt;REG,##CONTROL_STRUCT##_##REG##_##CLK##EN);\
} while(0)
</code></pre>

<p><strong>Macro call in main.c / All Parameters are defined in cpu specific header files:</strong></p>

<pre><code>__HAL_CLK_ENABLE(RCC,AHB1ENR,GPIOA);
</code></pre>

<p><strong>The result should be:</strong> </p>

<pre><code>SET_BIT(RCC-&gt;AHB1ENR,RCC_AHB1ENR_GPIOAEN)
</code></pre>

<p>This macro works and enables my GPIOA port correctly but I get two Compiler warnings. (IAR EW 7.6)</p>

<ol>
<li>macro Parameter "CONTROL_STRUCT" is used in both expanded and raw forms.
(I will ignore this warning, because in this case it's right to use both forms!)</li>
</ol>

<p><strong><em>2. concatenation with "RCC_AHB1ENR_GPIOAEN" in macro "__HAL_CLK_ENABLE" does not create a valid token.
(What does it mean? Because the token works correctly and my clock is enabled after calling this macro)</em></strong></p>

<p>Thanks</p>

<p><strong>EDIT1:</strong></p>

<p>Macro definitions:</p>

<pre><code>#define SET_BIT(REG, BIT)     ((REG) |= (BIT))

#define RCC                 ((RCC_TypeDef *) RCC_BASE)

typedef struct
{
...                        
__IO uint32_t AHB1ENR;
...
} RCC_TypeDef;

#define GPIOA               ((GPIO_TypeDef *) GPIOA_BASE)
</code></pre>