AnsweredAssumed Answered

Strange problem with #define under VisualDSP

Question asked by Rittmann on Dec 18, 2009
Latest reply on Dec 22, 2009 by Rittmann

Greetings,

 

while I was writing my code for a large project, all of a sudden a problem arised with some code I wrote months ago and which proved to work quite reliably. In essence, a #define CONSTANT (value) statement stopped working, leaving CONSTANt as if it didn't exist during run-time.

 

I'm somewhat surprised about this behaviour. It seems I have no memory problems - at least, VDK reports no memory problem -, and a backup from two days ago works fine. From that backup, I only added code (it is a large project based on BF534) in parts of the program with no connections with those files, so the only difference I guess I see is "bigger code" (but still not so large as to fill the memory sections).

 

To give a better picture about the issue, the defines are in a header in this form:

 

#define CONSTANT_1 (4)

#define CONSTANT_2 (1)

#define CONSTANT_3 (2)

#define CONSTANT_4 (4)

 

The header is included in the cpp file which uses the #define's, as usual. But when trying to do the following:

 

int i=0;

while (i<CONSTANT_1)

{

i++;

}

 

The expression just is always false. I looked into the debugging options from VisualDSP and found that the expression i<CONSTANT_1, and CONSTANT_1 itself, aren't defined (ERROR: Unknown variable or symbol).

 

I don't intent to get a solution with these few lines, but if anyone has an idea about where to begin to look. That would be great, because as I said at the beginning, I'm quite surprised about this.

Outcomes