passing strings byval into a subroutine - avr-gcc erroir
Posted: 09 January 2009, 13:50 PM
Hi
I don't get a avr-gcc compiler error if the sub takesastring is defined as byref, if its defined as below, i.e byval then i get the below errors... full at end of message.
I get the following error
Neil
I don't get a avr-gcc compiler error if the sub takesastring is defined as byref, if its defined as below, i.e byval then i get the below errors... full at end of message.
- undefined reference to `FIX_PARM_STR'
Code: Select all
sub takesastring(byval str as string)
end sub
Sub Main()
Dim str as string = "a string"
call takesastring(str)
End Sub
- >"C:\PROGRAM FILES\ZBASIC\zbasic.exe" --target-device=ZX24n --directory="C:/" --project="test7.pjt"
make: Entering directory `C:/zxTempDir/test7'
avr-gcc -c -Dzx24n -mmcu=atmega644p -std=gnu99 -fgnu89-inline -gdwarf-2 -Os -I"C:/PROGRAM FILES/ZBASIC/zxlib" -I. -Wall -Wstrict-prototypes -funsigned-char -fpack-struct test7.c -o test7.o
test7.c: In function 'zf_takesastring':
test7.c:53: warning: implicit declaration of function 'FIX_PARM_STR'
test7.c:55: warning: implicit declaration of function 'FREE_PARM_STR'
test7.c:53: warning: 'strTypeSave1' is used uninitialized in this function
avr-gcc -o test7.i1 -mmcu=atmega644p -L"C:/PROGRAM FILES/ZBASIC/zxlib" -Wl,-T,"C:/PROGRAM FILES/ZBASIC/zxlib/zx_avr5.lds" -u rtc_ISR -u default_ISR test7.o -lzx24n -lm
test7.o: In function `zf_takesastring':
C:\zxTempDir\test7/test7.c:53: undefined reference to `FIX_PARM_STR'
C:\zxTempDir\test7/test7.c:55: undefined reference to `FREE_PARM_STR'
make: *** [test7.i1] Error 1
make: Leaving directory `C:/zxTempDir/test7'
Error: one or more errors occurred in the back-end build process for "test7.zxb"
>Exit code: 1
Neil