bmx-ng / bcc

A next-generation bcc parser for BlitzMax
zlib License
33 stars 12 forks source link

Inline: Issues with strings in inlined functions #666

Open GWRon opened 5 months ago

GWRon commented 5 months ago
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