Skip to content

cortex-m-semihosting: hprint! family of macros do not format strings without arguments #581

@suaviloquence

Description

@suaviloquence

In the hprint! macros:

#[macro_export]
macro_rules! hprint {
($s:expr) => {
$crate::export::hstdout_str($s)
};
($($tt:tt)*) => {
$crate::export::hstdout_fmt(format_args!($($tt)*))
};
}

They do not print format strings with no arguments (e.g., hprint!("{address}") is sugar for hprint!("{}", address), which is a deviation from the stdlib print! macros using format_args!.

If it's acceptable performance-wise, I can submit a PR to use e.g. hstdout_fmt in this case instead of hstdout_str, otherwise I can document this deviation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions