llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.13k stars 11.11k forks source link

bugprone-macro-parentheses on include #84636

Open cyclops1982 opened 4 months ago

cyclops1982 commented 4 months ago

Hi,

I'm a n00b at this stuff, so please let me know if i'm just not getting it.

LVGL's lv_drivers project is using # define SDL_INCLUDE_PATH <SDL2/SDL.h> in their code.

We use the lv_drivers in our project and it causes a bugprone-macro-parentheses warning. I don't know what's wrong with this use, or what the potential bug could be with such usage. I've had a look at the test cases where i think this usage is missing.

llvmbot commented 4 months ago

@llvm/issue-subscribers-clang-tidy

Author: Ruben (cyclops1982)

Hi, I'm a n00b at this stuff, so please let me know if i'm just not getting it. [LVGL](https://github.com/lvgl)'s [lv_drivers](https://github.com/lvgl/lv_drivers/) project is using `# define SDL_INCLUDE_PATH <SDL2/SDL.h>` in [their code](https://github.com/lvgl/lv_drivers/blob/0091dc612facc94dce1061a9b78d641c77f1791a/lv_drv_conf_template.h#L109). We use the lv_drivers in our project and it causes a bugprone-macro-parentheses warning. I don't know what's wrong with this use, or what the potential bug could be with such usage. I've had a look at the [test cases](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/test/clang-tidy/checkers/bugprone/macro-parentheses.cpp) where i think this usage is missing.