Alexey Orlov
Alexey Orlov

Reputation: 2824

C: Empty parentheses trailing the #define directive name; there's a body to the directive

#define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)

What is the meaning of () here?

Upvotes: 1

Views: 88

Answers (1)

Mike Kinghan
Mike Kinghan

Reputation: 61610

The empty parameter list in #define __HAL_DBGMCU_FREEZE_TIM2() is unnecessary but innocuous. It is fairly common practice to define a macro with an empty parameter list to document the fact that it is a function-like macro, rather than the definition of a constant.

Upvotes: 1

Related Questions