-
Notifications
You must be signed in to change notification settings - Fork 183
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
Test 63_typedef fails #6
Comments
This is related to the size of int64/uint64 on your machine. The number within angle brackets designates the size of the number. It is expected to be 8 bytes, but is 4 bytes in size. The tests expects a 64bit version OS, I guess. Bottom line: The test is not failing because the software is not correct, but because of false internal premises. Disclaimer: I am not affiliated with this software in any way, I just found your issue and thought I might clear things up a bit. |
Yup, definitely something broken with the 64bit types. I just assumed that the interpreter would execute in a run-time that was independent of sizeof(unsigned long) for the host architecture. I don't have time to dig deeper here right now, but I guess the type definitions for the interpreter run-time, and not necessarily for the host platform, is the issue. |
This is actually standard-conformant behaviour. |
Yup, the test is broken. I had a look in the code, and it seems that TypeUnsignedLong is defined in interpreter.h. Then in type.c, TypeSizeValue, an assumption is made that sizeof(unsigned long) <= sizeof(ALIGN_TYPE), which happens to be void * (defined in platform.h). Thus, it is broken. I did a fugly fix to the test (using sizeof(x64) and sizeof(u64) to fake the output on non-64-bit platform). I'm preparing the pull request right now. |
This is the fix mentioned in the previous comment: #8 . |
I have a fork that fixes this problem (galacticstudios@abd7473). It implements picoc's 'long' as an int64_t, so that picoc's long will be 64 bits on every platform. I've tested on Windows (MS Visual C++ 2013 or newer) and on Linux. I've also fixed a bunch of compiler warnings on MSVC. |
Anyone know if/when these fixes will make it into master?
|
Hey galacticstudios, want to send me a pull request with your fixes? |
I've sent a pull request - I think. I haven't done it before so let me know if I did it wrong.
|
When running the tests, the typedef test case fails.
I'm running the test on an i686 installation.
The text was updated successfully, but these errors were encountered: