-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement various Windows build fixes #14
Conversation
Hi @braewoods , thanks for the contribution and helping on the Windows front! 💯 Your changes looks good but I have the following two questions:
|
Fair, but I didn't think it would matter in practice because non-const variables will get silently promoted to const in such contexts.
I was getting compiler warnings on the UCRT64 toolchain because ntohl returns an unsigned long, where as PRIu32 resolves to a printf specifier for unsigned int. In practice this should not matter for Windows because long and int are the same size even on 64 bit Windows, but this is the ABI Microsoft decided on, and I have no idea why GCC is even warning for it. |
First set of changes done. |
Here's the errors I was getting without my changes:
|
Yep, I'm aware that promotion takes place, but I prefer code to be as correct as possible, thanks for updating it!
Yes, I went again to check my toy example where I was testing this and I made a silly mistake. I now got the same warning you were getting and understand why too as you explained. However, instead of fprintf(stream, " Layer Vector ........... %" PRIu32 "\n", (uint32_t) ntohl(packet->root.vector)); How does that sound to you? |
Fine by me. It's been changed. I just felt like the macro one was better at explaining why the code was modified for future readers, due to the WIN32 macro check. |
Mmh yeah I think that you are right. The macro check was indeed better at explaining. |
That should do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
This also closes #12.