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

Fix stlink on mingw64 #569

Merged
merged 1 commit into from
Mar 14, 2017
Merged

Fix stlink on mingw64 #569

merged 1 commit into from
Mar 14, 2017

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Mar 14, 2017

%zx gets printed as zx. Just using %x suffices in the cases in this PR.

This fixes stlink for us.

@xor-gate xor-gate merged commit f73ec11 into stlink-org:master Mar 14, 2017
@xor-gate xor-gate added this to the v1.3.2 milestone Mar 14, 2017
@xor-gate
Copy link
Member

Great, thanks for the improvement!

xor-gate added a commit that referenced this pull request Mar 15, 2017
xor-gate added a commit that referenced this pull request Mar 15, 2017
* Revert "fixed support for STM32L011 (#572)"

This reverts commit dc90553.

* Revert "Fix possible memory leak (#571)"

This reverts commit 8efd3ad.

* Revert "Fix stlink on mingw64 (#569)"

This reverts commit f73ec11.
@xor-gate xor-gate removed this from the v1.3.2 milestone Mar 15, 2017
@xor-gate
Copy link
Member

Sorry reverted in PR #573

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 15, 2017

Hmmm... That's unfortunate... Isn't there a platform independent formatting? We could cast it to something that works everywhere.
Also, why wasn't this caught by Travis?

@xor-gate
Copy link
Member

xor-gate commented Mar 15, 2017

yes, %zu is in the C99 standard. but .... mingw64 wraps windows printf which probably doesn't support it (or use %Ix "which is portable accoding to microsoft MSDN") :(
https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx
http://stackoverflow.com/a/22114959/1836746

and

https://busybox.net/~landley/c99-draft.html#7.19.6

z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t 
or the corresponding signed integer type argument; or that a following n 
conversion specifier applies to a pointer to a signed integer type corresponding to size_t argument.

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 15, 2017

Would you accept a PR turning formatting warnings into errors on Travis and casting all size_t formatting to unsigned long long before formatting?

@xor-gate
Copy link
Member

xor-gate commented Mar 15, 2017 via email

@xor-gate xor-gate added this to the v1.3.2 milestone May 6, 2017
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants