C6000 Codegen 6.1.19
Here's a snippet from a header file:
IQmath_inline_all.h said:
static inline I32_IQ _atoIQN(const char *A, U32_IQ q_value)
{
#define c1 ((I32_IQ)(0xffffffff))
#define c2 ((I64_IQ)(0xffffffff80000000))
#define c3 ((I64_IQ)(0x7fffffff))
#define c4 ((I32_IQ)(0x80000000))
#define c5 ((0xffffffff))
#define c6 ((0x80000000))
Inside a C source file we are including this header file. It just so happens there is a local variable c1 inside the source file like this:
unsigned char c1 = 0;
This causes the compiler to throw an error related to I32_IQ. I have worked around the problem temporarily by commenting out the function _atoIQN inside IQmath_inline_all.h. However, I'm trying to determine if there's something we should do differently in _atoIQN such as adding #undef statements, or if maybe this is a compiler bug, i.e. should the scope of the #define be limited to the function it's in? Perhaps since it's inlined the scope expands to the function into which it is being inlined?
Hopefully one of you codegen gurus can set me straight. :)
Thanks,
Brad