Would it be possible to add rule cpp:S963 to C rule set?

  • I would like cpp:S963 to be added to C rules. Forgetting to add parenthesis around macro arguments can cause the same issues in both cpp and c languages.
  • snippet of Noncompliant Code: #define ms_to_us(time_ms) (time_ms * 1000)
  • snippet of Compilant Code: #define ms_to_us(time_ms) ((time_ms) * 1000)
  • external references and/or language specifications: cpp:S963
  • type : Code Smell
  • Tags: cpp

Hi @MinPun ,

I agree that your suggestion makes sense. I have created a CPP-5742 ticket that you can use to track the progress.