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

Build on Windows has a wrong function output #9055

Open
joa-quim opened this issue Jul 11, 2024 · 3 comments
Open

Build on Windows has a wrong function output #9055

joa-quim opened this issue Jul 11, 2024 · 3 comments

Comments

@joa-quim
Copy link
Contributor

joa-quim commented Jul 11, 2024

This simple function
https://github.com/GenericMappingTools/gmt/blob/master/src/gmt_io.c#L9427
produces wrong output on Windows, but only on Windows and because of it the GMT CI tests fail on Windows.

It returns false when it should return true, and this only happened with the Yggdrasil build on Windows. That function works well for all other OSs, it works well on my local MSVC build and even if build a similar one locally with MinGW.

This returns true in all but the Yggdrasil build for Windows. In the mention function (gmt_is_float()) I even added an extra test for the MinGW compiler, but it still fails

ccall((:gmt_is_float, GMT.libgmt), Bool, (Cstring, Ptr{UInt8}), GMT.GMT_Get_Ctrl(GMT.G_API[1]), "0.25")
false
@eschnett
Copy link
Contributor

I notice that the special function for Windows doesn't allow for signs (+, -). These might appear before the number as well as in the exponent.

@eschnett
Copy link
Contributor

I would also consider calling sscanf("%*lf%n", &n) instead (avoid dummy value, no white space).

And I wonder whether the numeric value might be nan or infinity...

@joa-quim
Copy link
Contributor Author

Yes, you're right about the +- but that was a failed attempt to try to fix the problem. I even wonder if the MINGW macro is defined there.

No problems with NaNs. They are catch by code run before calling this function. For example
https://github.com/GenericMappingTools/gmt/blob/master/src/gmt_support.c#L19282

A problem with testing other things is that I need to go for the full processes of requesting the build of another GMT_jll to see what happens.

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

2 participants