Comments (3)
Hi lionfaith!
in some contexts, constant propagation for the modulous function was
behaving incorrectly. I have fixed it in the 6.04 release on my web site.
David
lionfaith wrote:
Hello David!
I stepped upon a strange behavior of modulo operator which I could
reduce to this sample:#include <stdlib.h>
#include <stdio.h>class Math {
private:
Math(){}
public:
static int rrand(int min,int max)
{
int r = min;
max++;
if ((max - min) ==0)
return min;
r +=rand() % ( max - min );
return r;
}
};void main(void) {
printf("value: %d",Math::rrand(-3,3) );
}Value should be between -3 and 3, but it is as if |%| didn't work.
Strangest of all is that making this change:int delta;
r += rand() % ( delta = max - min );did remove the bug from the project I am compiling while it does not
remove it from the small excerpt I gave you up above. Putting the
definition of |class Math| in a header is not enough to change that
fact. I just don't understand what changes the behavior.I hope it helps,
Lionfaith—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#27, or mute the thread
https://github.com/notifications/unsubscribe-auth/AETkIZG03OGzNnbH5m8ArfujemJ_7Uduks5qgLN3gaJpZM4JkptU.
from orangec.
Hi David,
thanks for the work you do so fast!
It was actually a long standing bug for the game I want to compile. It seems to work pretty well now.
Lionfaith
from orangec.
Hi lionfaith,
you're welcome!
the vast majority of the time I end up making small tweaks to the
compiler to fix bugs, it is rare that I have a bug that takes deep
rework like the ones related to the compile time issue you had recently :)
I really appreciate that you dig into the issues and can usually isolate
them to a small example; that makes it much easier on me.
David
lionfaith wrote:
Hi David,
thanks for the work you do so fast!It was actually a long standing bug for the game I want to compile. It
seems to work pretty well now.Lionfaith
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#27 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AETkIRtR3WzjnL6zUo0DYYU60vWLp7Biks5qgRbqgaJpZM4JkptU.
from orangec.
Related Issues (20)
- Add `dist-clean` make target
- Debug build Orange C on MSYS2 (MINGW64) with `omake`
- Support using of `mingw32-make` to build Orange C on Windows Command Prompt HOT 4
- `ORANGEC_ONLY=YES` doesn't work with `mingw32-make`
- Possibly incompatibility between `omake` and `mingw32-make` HOT 1
- What do you think about adding something like `osed`? HOT 5
- `HAVE_UNISTD_H` is misleading HOT 9
- Even on MSYS2 it's possible to call `cmd.exe` HOT 3
- `src/clibs/platform/win32/makefile` HOT 12
- `mingw32-make` doesn't correctly create the zipped files HOT 1
- Decoupling Orange C from MSYS2 HOT 1
- Modify the tokenizer to be reusable with different keywords for the same project. HOT 11
- [AppVeyor] `omake` crashed HOT 18
- omake should handle GNU make's `--jobserver-auth=` switch HOT 4
- `omake COMPILER=OCC exebuild` failed
- Support for `_set_thread_local_invalid_parameter_handler`? HOT 3
- Adding CPU targeting and CPU specific optimizations HOT 1
- Fix crash in generated executable
- Template specialization problem
- Crash in for-range statement
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 orangec.