I have the equivalent of:
typedef unsigned long codeptr_t;
void y(void) {};
codeptr_t x = (codeptr_t) y;
The compiler accepts this with no error or warning, but actually discards the high bytes, effectively doing:
codeptr_t x = (codeptr_t)((unsigned int) y);
This is in the context of the task scheduler of a RTOS.
Environment is MSP430F5438 on CCS Version: 5.1.1.00031