Hello Mad Scientists -- I have a workaround for this issue, but wanted it to get reported because it seems like it should be a simple fix (he naively expects...)
Subset of code (names changed to protect the guilty):
// Note: UINT8 is defined in another header to be, not surprisingly, uint8_t]
/*******************************************************************************
* DATA TYPES
******************************************************************************/
typedef UINT8 DeviceType_t;
/*******************************************************************************
* CONSTANTS & MACROS
******************************************************************************/
#define ONE_DEVICE_VAL (0x00)
#define ANOTHER_DEVICE_VAL (0x01)
#define THE_LAST_DEVICE_VAL (0x02)
static const DeviceType_t ONE_DEVICE = (DeviceType_t) ONE_DEVICE_VAL;
static const DeviceType_t ANOTHER_DEVICE = (DeviceType_t) ANOTHER_DEVICE_VAL;
static const DeviceType_t THE_LAST_DEVICE = (DeviceType_t) THE_LAST_DEVICE_VAL;Error Generated:
🧨 EXCEPTION: CMock >> Failed Parsing Declaration Prototype!
declaration: 'const DeviceType_t ONE_DEVICE =(DeviceType_t)(0x01)'
modifier: ''
return: {:type => '', :name => 'cmock_to_return', :str => ' cmock_to_return', :void? => false, :ptr? => false, :const? => false, :const_ptr? => false}
function: '(DeviceType_t)'
args: [{:ptr? => false, :const? => false, :const_ptr? => false, :name => 'cmock_arg1', :type => '0x01'}]
🌱 Ceedling could not complete operations because of errors
Workaround:
Remove the parenthesis on the #defines:
#define ONE_DEVICE_VAL 0x00
#define ANOTHER_DEVICE_VAL 0x01
#define THE_LAST_DEVICE_VAL 0x02