|
zneocc compiler dies with simple #define macro 6 Months, 3 Weeks ago
|
Karma: 0
|
|
Hello,
I'm using the zneocc compiler from the ZDS II ZNEO version 5.0.1 (compiler version 1.13) running under Windows 7.
The following simple C file, containing little more than a simple macro expansion, will kill the compiler with the message
P1: Internal Error(0xFFC2A5)
Please contact Technical Support
File: D:WAVEFRONTPETARDS_DEFENSETESTSKILL_COMPILERKILL_COMPILER_2KILL_COMPILER_2.C
Relative Line: 10
----8<------- kill_compiler.c -----
#define D(b7, b6, b5, b4, b3, b2, b1, b0) ( ((b7) << 7) | ((b6) << 6) | ((b5) << 5) | ((b4) << 4) | ((b3) << 3) | ((b2) << 2) | ((b1) << 1) | (b0) )
void f(void)
{
static int i = D(
/* disable the potrzebie counter */ 0,
/* this bit controls function K */ 0,
/* these two bite enable the frammistan */ 1, 0,
/* engage cloaking device, mode 1 */ 0, 1,
/* turn on the RED led marked "panic" */ 1);
}
----8<------------------------------
The problem appears to be that the compiler's C pre-processor has a too-small fixed-size buffer, approx. 250 characters in length, that is over-filled by the above: if the comments are removed and all the arguments to D() placed on one line then this example will compile - but of course this is a completely contrived example to demonstrate the problem...
|
|
|
|
|
|
|
Re:zneocc compiler dies with simple #define macro 6 Months, 3 Weeks ago
|
Karma: 0
|
|
I have found that the fastest wayto get around this is to just use the C pre-processor from GNU GCC (MinGW) to handle the macro expansion and a small one-off utility to massage the output from that so that zneocc will accept it.
|
|
|
|
|
|
|
Re:zneocc compiler dies with simple #define macro 6 Months ago
|
Karma: 4
|
|
Stephen
The developers looked at your code and received the message "Incorrect number of arguments for macro D" from the ZNEO compiler.
When I implemented it, I was able to successfully compile by adding the extra parameter and the "" at the end of the line (macros do not like to be split between lines).
They did, however, receive the Internal Error message on the released Acclaim compiler, which they are looking into.
|
|
|
|
|
|
|
Re:zneocc compiler dies with simple #define macro 6 Months ago
|
Karma: 0
|
|
Tom,
Thanks the reply - it is good that you've been able to generate the internal error.
The #define statement being broken across two lines was, of course, just word-wrapping done by the forum editor, but it does seem that I lost one of the arguments to the invocation of the macro whilst pasting into the message and didn't spot that before posting. Oops. Interestingly, when I edited my real C file to remove that argument (and match what was posted), the zneocc compiler I've got doesn't generate a "Incorrect number of arguments for macro D" message - I'm guessing that it hit the internal error before it got to checking the parameter count.
Regards,
Stephen
|
|
|
|
|
|
|