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

Peculiar printf() behaviour, i686 version of mingw #81

Open
ChristianIvarsson opened this issue Oct 4, 2024 · 1 comment
Open

Peculiar printf() behaviour, i686 version of mingw #81

ChristianIvarsson opened this issue Oct 4, 2024 · 1 comment

Comments

@ChristianIvarsson
Copy link

Hi everyone!
I've noticed some really weird quirks with functions that utilise va_list et. al
Looks like values are extended to 64-bit before being pushed onto the stack and then interpreted as 32-bit on the other end?
All values are fixed point integers btw. Just in case someone picks up on vertex and thinks "float".

I suspect the answer is "stop targeting old crusty 32-bit junk" but I figured I'd file an issue just in case 😄

Compiler versions tested:

  • i686-14.2.0-release-posix-dwarf-msvcrt-rt_v12-rev0
  • i686-14.1.0-release-posix-dwarf-msvcrt-rt_v12-rev0
  • i686-13.2.0-release-posix-dwarf-msvcrt-rt_v11-rev1

OS versions tested:

  • Windows 10, x64. Not entirely sure of build number but it's up to date
  • Windows 8, 32-bit.
printf("Vertex 0 V{ %d, %d, %d } U{ %u, %u }\n",
    point0->vertex.X, point0->vertex.Y, point0->vertex.Z,
    point0->uv.U, point0->uv.V);

// Incorrect
> Vertex 0 V{ 184, 0, 274 } U{ 0, 19293 }


printf("Vertex 0 X %d\n", point0->vertex.X);
printf("Vertex 0 Y %d\n", point0->vertex.Y);
printf("Vertex 0 Z %d\n", point0->vertex.Z);
printf("Vertex 0 U %u\n", point0->uv.U);
printf("Vertex 0 V %u\n", point0->uv.V);

// Expected values
> Vertex 0 X 184
> Vertex 0 Y 274
> Vertex 0 Z 19293
> Vertex 0 U 49
> Vertex 0 V 68
@niXman
Copy link
Owner

niXman commented Nov 21, 2024

Could you please report this to gcc bugzilla?: https://gcc.gnu.org/bugzilla/

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