Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline: Issues with strings in inlined functions #666

Open
GWRon opened this issue Jun 5, 2024 · 0 comments
Open

Inline: Issues with strings in inlined functions #666

GWRon opened this issue Jun 5, 2024 · 0 comments

Comments

@GWRon
Copy link
Contributor

GWRon commented Jun 5, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant