bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Inline: Issues with strings in inlined functions

Open GWRon opened this issue 8 months ago • 0 comments

SuperStrict
Framework Brl.StandardIO

Function FGlobal:Int() inline
	Print("FGlobal")
End Function

Results in:

Building untitled1
[  9%] Processing:untitled1.bmx
[ 91%] Compiling:untitled1.bmx.console.release.linux.x64.c
In file included from /BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.c:1:
/BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.h: In function ‘_m_untitled1_FGlobal’:
/BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.h:9:42: error: ‘_s0’ undeclared (first use in this function)
    9 |         brl_standardio_Print((BBString*)&_s0);
      |                                          ^~~
/BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.h:9:42: note: each undeclared identifier is reported only once for each function it appears in
Build Error: failed to compile (256) //BlitzMaxNG/tmp/.bmx/untitled1.bmx.console.release.linux.x64.c
Process complete

Same error for

Function FGlobal:Int() inline
	Local s:String="FGlobal"
	Print(s)
End Function

While it works when passing an integer instead:

Function FGlobal:Int() inline
	Local i:Int=10
	Print(i)
End Function

But again fails when passing an integer directly to print (and thus creating the string there differently:

Function FGlobal:Int() inline
	Print(10)
End Function

GWRon avatar Jun 05 '24 10:06 GWRon