Skip to main content
Visitor II
July 29, 2020
Question

Use of __LINE__ as a macro parameter conflicts with standard C usage.

  • July 29, 2020
  • 1 reply
  • 978 views

Several macros in stm32f4xx_hal_exti.h use __LINE__ as a macro parameter. Example:

#define IS_EXTI_PENDING_EDGE(__LINE__) ((__LINE__) == EXTI_TRIGGER_RISING_FALLING)

__LINE__ is a reserved preprocessor symbol which expands to the integer line number of the file in which it is parsed. It should not be used as it is now. F4 HAL library v1.25 (and others).

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    September 25, 2020

    Hi @Charles Miller​ ,

    Even if it is with some delay, it remains relevant to report what you highlighted to our development team. This is what I did.

    Thanks,

    -Amel