0
GCC 4.1.2 C99重新聲明枚舉
,我有以下枚舉在這個文件ccsmd.h:
enum options_e
{
acm = 0,
anm,
smd,
LAST_ENTRY,
ENTRY_COUNT = LAST_ENTRY
};
enum function_mode_e
{
play = 0,
record,
bridge,
LAST_ENTRY,
ENTRY_COUNT = LAST_ENTRY
};
錯誤消息:
error: redeclaration of enumerator ‘LAST_ENTRY’
error: previous definition of ‘LAST_ENTRY’ was here
error: redeclaration of enumerator ‘ENTRY_COUNT’
error: previous definition of ‘ENTRY_COUNT’ was here
我有LAST_ENTRY
使我可以使用它作爲數組的索引。所以我喜歡在所有枚舉中保持相同。