Comments (9)
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. unsigned long
is declared to be uint64_t
at the top of the test, which does not hold true for every architecture.
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.
from picoc.
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.
from picoc.
This is actually standard-conformant behaviour. unsigned long
is not guaranteed to be 64 bits in any way. If you just typedef uint64_t
as that, you will have a bad time.
from picoc.
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.
from picoc.
This is the fix mentioned in the previous comment: #8 .
from picoc.
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.
from picoc.
Anyone know if/when these fixes will make it into master?
I ran into this issue today on my Raspberry Pi 3 B, running 32-bit Raspbian 8.
root@raspberrypi:~# uname -r -m -o
4.4.13-v7+ armv7l GNU/Linux
from picoc.
Hey galacticstudios, want to send me a pull request with your fixes?
from picoc.
I've sent a pull request - I think. I haven't done it before so let me know if I did it wrong.
- Bob
from picoc.
Related Issues (20)
- Add basic travis-ci.org support
- Memory leaks with static variables HOT 2
- External includes repeatedly included
- Failed assertion when combining assignment of four or more variables HOT 1
- How modify HOT 2
- Apply the picoc in the embedded system of extreme low resource HOT 3
- Unable to declare a function pointer
- Macro expansion is self-contained
- Character constants are incorrectly typed
- Integer promotion does not function as expected HOT 1
- Uninitialised structure field HOT 2
- Reset Picoc_Struct state
- Question for Arduino HOT 6
- How can I call PicoC to run a program in a string calling main() ? HOT 2
- Releases HOT 2
- Fetching Variables
- bad type declaration
- Benchmarks? HOT 1
- callbacks
- GitLab is either private or empty- 404 on fetch HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picoc.