enum type check in C/gcc

前端 未结 6 960
小鲜肉
小鲜肉 2020-12-03 03:19

See the simple example below. When a function returning one enum is assigned to a variable of a different enum I don\'t get any warning even with <

6条回答
  •  遥遥无期
    2020-12-03 03:58

    gcc guys always have a reason not to do somthing.

    Use clang with options -Wenum-conversion -Wassign-enum.

提交回复
热议问题