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

Wrong linker option syntax for printf and scanf with float support #31168

Closed
ArseniSoitu opened this issue Jan 7, 2021 · 3 comments
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@ArseniSoitu
Copy link

$<$<BOOL:${CONFIG_NEWLIB_LIBC_FLOAT_PRINTF}>:-u_printf_float>

Hello.

Seems that space need to be inserted between "-u" and "_printf_float"
Same on line 38

Thank You

@pabigot
Copy link
Collaborator

pabigot commented Jan 11, 2021

Since that syntax has been in place for three years, it's unlikely to be wrong. Are you getting compilation errors?

@pabigot pabigot self-assigned this Jan 11, 2021
@pabigot pabigot added priority: low Low impact/importance bug bug The issue is a bug, or the PR is fixing a bug labels Jan 11, 2021
@ArseniSoitu
Copy link
Author

ArseniSoitu commented Jan 12, 2021

Since that syntax has been in place for three years, it's unlikely to be wrong. Are you getting compilation errors?

Hmm. Tried to use sprintf() to convert float to char string on stm32f413zh with code:
char value[32];
voltage = 100.1f;
n = sprintf(value,"%4.1f", voltage);
Result was 0.000(don't remember actual number of zeros) in value.
But now after full rebuild I can't reproduce this bug.

I apologise for inconvenience

@pabigot
Copy link
Collaborator

pabigot commented Jan 12, 2021

Thanks for the update.

@pabigot pabigot closed this as completed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

2 participants