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

warning about inlining on function that is not even included in the optimized code #13

Open
flocsy opened this issue Mar 19, 2024 · 0 comments

Comments

@flocsy
Copy link

flocsy commented Mar 19, 2024

(:inline)
function timeFormatMs() as String {
    return timeFormat(Time.now()) + '.' + (System.getTimer() % 1000).format("%03d");
}

(:inline)
function timeFormat(moment as Moment) as String {
    var time = Time.Gregorian.info(moment as Moment, Time.FORMAT_SHORT);
    return time.hour.format("%02d") + ':' + time.min.format("%02d") + ':' + time.sec.format("%02d");
}

function logRelease(msg as String?) as Void {
    var time = timeFormat(Time.now());
    System.println(time + " " + msg);
}

call logReleaase("something") somewhere.

Warning on the call of timeFormat from timeFormatMs:
fenix6: Prettier.mc:32:12: While inlining timeFormat: This function can only be inlined in statement, assignment, if or return contexts

While this is true, it's irrelevant as timeFormatMs is not even called anywhere and is excluded from the optimized source code.

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