compilation error at debug.print

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
wwwoholic
Posts: 53
Joined: 23 December 2010, 20:58 PM

compilation error at debug.print

Post by wwwoholic »

The following line produces an error in 4.1.7:
Debug.Print CStr(CInt(VRL)); " "; CStr(CInt(VRR))

There is no error if I remove " "; from the output or replace it with something else, like "-";

Code: Select all

avr-gcc -o scooter.i1 -mmcu=atmega1280 -Wl,--gc-sections,--relax   -Wl,-T,"C:/PROGRA~2/ZBasic/zlib/avr/ldscripts/zbasic_avr51.lds"  -Wl,--defsym,zbSendByte=zbSendByteHW -Wl,--defsym,zbBaudDivisor=zbBaudDivSimple -Wl,--defsym,zbUartData=zbUartData4 --param inline-call-cost=2 "C:/PROGRA~2/ZBasic/zlib/avr/arch/zbasic_avr51.o" "C:/PROGRA~2/ZBasic/zlib/avr/ST/libST_mega1280.a"  scooter.o config.o util.o comlib.o motorlib.o servolib.o RoboteqMDC2250C.o devices.o cinput.o curves.o geometry.o motors.o   "C:/PROGRA~2/ZBasic/zlib/avr/lib/libmega1280.a" "C:/PROGRA~2/ZBasic/zlib/avr/ST/libST_mega1280.a" -lm
c:/progra~2/zbasic/winavr/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr51/crtm1280.o: In function `__vector_default':
(.vectors+0xdc): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_55' defined in .text section in C:/PROGRA~2/ZBasic/zlib/avr/lib/libmega1280.a(com8_ISR_avr.o)
make: *** [scooter.i1] Error 1
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Using the clues present in the information you posted, I tried to determine the cause of the problem - to no avail, unfortunately. A "relocation truncation error" problem like this (link-time computation of a limited-range relative branch) depends on the size and organization of the application. As you've noted, making a small change can be enough to allow a successful computation. Here again, having access to all of the application source code will facilitate tracking down the issue.
- Don Kinzer
wwwoholic
Posts: 53
Joined: 23 December 2010, 20:58 PM

Post by wwwoholic »

I wonder how that string literal stored though, because changing the character does not change the length of a string, so technically there should be absolutely no difference form the compiler's point of view... unless string constants are shared and I have another " " somewhere in the program.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

wwwoholic wrote: unless string constants are shared and I have another " " somewhere in the program.
The compiler does implement a constant string pool allowing multiple uses of identical strings to be shared.
- Don Kinzer
Post Reply