Home/Support/Support Forum/Had a new one today using DC10.72...an error from the compiler said "Cannot load object, report to Rabbit"
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Had a new one today using DC10.72...an error from the compiler said "Cannot load object, report to Rabbit"

+1 vote
Using 10.72...The error is a bit strange. I hit it when using some macros to do some runtime detection. The following test program compiles fine (target happens to be RCM6750):

#define MACRO1 (0)

main() {

int i,j;

i = 0;
j = 0;

if (i == 0 || (MACRO1 == 1 || j == 0)) {
printf("All is well");
}
}

And this one causes the compiler error:

#define MACRO1 (0)

main() {

int i,j;

i = 0;
j = 0;

if (i == 0 || (MACRO1 == 1 && j == 0)) {
printf("All is well");
}
}

The delta being the last && vs ||.

If I change MACRO1 to something that will evaluates as true, the error goes away. I tried optimization changes for size and speed to no avail. Different values for i and j also don't matter. And, if the initial i == 0 isn't present, the error doesn't occur.

I can work around using different constructs, but this one seemed quite strange. Anybody ever see it?
asked Dec 22, 2017 in Rabbit by daveoman New to the Community (7 points)

Please log in or register to answer this question.

1 Answer

0 votes
 
Best answer
This one is strange, and it looks like an error in how the compiler short-circuits conditionals at compile-time.

The compiler should be able to reduce that code to "if (i == 0)", but I believe it's stumbling on what to do with the "j == 0".

Thanks for pointing out the error -- I'll make sure it's added as a "known issue" in the next Dynamic C release so we can investigate it if/when we work on the compiler again.
answered Dec 26, 2017 by TomCollins Veteran of the Digi Community (1,681 points)
selected Jan 5, 2018 by daveoman
...