Compiler Bug - v. 2.5.2.20
jjames
Posts: 2,908
Luckily I did not spend a whole lot of time figuring this one out, but I could see it being a complete "day killer."
I was parsing a CSV file, and the commas were being stuck at the end, so I was doing the simple trick of SET_LENGTH_STRING(string,LENGTH_STRING(string)-1), which was working. However I made a goof on one of my strings so it wasn't doing it. The string in question happened to have been a bitmap, so when I noticed the bitmaps were not changing, I checked notifications. Notifications showed this:
Notice the end of the string, there's a commas. So I checked debugger, but there was no comma. So I made up some variables like so:
I did a debugger - and none of them had commas at the end. HOWEVER!!! - the length reported by the debugger was correct. So if you had a variable with a value of "123," - it would show up in debuger with a length of 4, however only show "123"; it does not show it in HEX or any other representation - it just seems to vanish.
I spent only about 20-30 minutes figuring this one out - but could completely see wasting an entire day on it.
So - long story short - be careful with your commas.
I was parsing a CSV file, and the commas were being stuck at the end, so I was doing the simple trick of SET_LENGTH_STRING(string,LENGTH_STRING(string)-1), which was working. However I made a goof on one of my strings so it wasn't doing it. The string in question happened to have been a bitmap, so when I noticed the bitmaps were not changing, I checked notifications. Notifications showed this:
[10:19:10 AM]Line 36 (10:16:44.567):: Command To [10001:1:1]-[^BMP-158,1,dtv_3480074-OFF.png,]
Notice the end of the string, there's a commas. So I checked debugger, but there was no comma. So I made up some variables like so:
VOLATILE CHAR cCommaTest0[] = 'there is a comma at the end of this line,'; VOLATILE CHAR cCommaTest1[] = 'there,is also, a comma, at the end of this line,'; VOLATILE CHAR cCommaTest2[] = 'there are two commas at the end of this line,,'; VOLATILE CHAR cCommaTest3[] = 'there are, two, commas, at the, end of, this line,,';
I did a debugger - and none of them had commas at the end. HOWEVER!!! - the length reported by the debugger was correct. So if you had a variable with a value of "123," - it would show up in debuger with a length of 4, however only show "123"; it does not show it in HEX or any other representation - it just seems to vanish.
I spent only about 20-30 minutes figuring this one out - but could completely see wasting an entire day on it.
So - long story short - be careful with your commas.
0
Comments
It certainly is a bug in the debugger that should be added to the list.
You're right......