【发布时间】:2013-06-13 09:26:33
【问题描述】:
我有以下 C 代码行,其中 cfType 是普通的 C 枚举类型:
int foo (double * parameters) {
...
cfType coefSelect = (cfType) *parameters; /* The double pointed by at parameters
* is cast to a cfType enum and result
* is put in the var coefSelect.
*/
...
}
但是编译器在强制转换行给出“枚举类型与另一种类型混合”的警告 - 但强制转换不应该阻止这个警告吗?
我在 Code Composer Studio 中使用 Texas Instruments 的 C2000 C 编译器
【问题讨论】:
-
enums 是int类型 -
@GrijeshChauhan 他们不是,
enum是整数类型 -
奇怪的设计... S-/
标签: c casting enums compiler-warnings