0

I am looking over some older code someone else wrote and the person is often using this type of code:

typedef enum {
  id1=1
  id2=11
  id3=2
  id4=3
} enumName_e

This type is then used in functions all over the place. While this works clang-tidy is complaining that using should be used instead of typedef which in this case won't work easily. Is this bad code that should be changed or is clang-tidy wrong here?

Jundarer
  • 45
  • 6
  • 2
    clang-tidy is getting confused because you're running C++ checks on C code. – sweenish Jan 07 '21 at 16:42
  • Ok that makes sense thank you. Interestingly enough most of the code is C++ and this was all in .h files which are commonly used in C++ so I kinda assumed this was C++ as well – Jundarer Jan 07 '21 at 17:17
  • After further inspection that code is definitely used for C++ compilation exclusively. Is it still fine to have it this way? – Jundarer Jan 07 '21 at 18:32

0 Answers0