Closed rempas closed 2 years ago
I will check this later, but it may be related to stack alignment bug. I've figured out, that not only syscalls have incorrect stack alignment generated, but regular functions do too on linux.
Oh ok! Don't worry about the time, just take it easy and have fun ;)
Can you verify that this still doesn't work with master version?
note that to_str(32)
is the same as to_str[u8](32)
, and to_str(-10)
is the same as to_str[i8](-10)
also, if you are doing zero-terminated strings (which I don't recommend as we have slices in the language), you should allocate an extra byte at the end and set it to 0
But the actual problem seems to be in cast(u8)(num % 10)
. For some reason doing remainder on i8
doesn't behave correctly, other types seem ok
yep, it is a bug with 8bit division. I implemented all sizes the same way, but 8 bits is special
got caught in a bit of a problem with int literal types
should be working now. Might need some casts here and there
10 is i32
now btw
Nice! It works as expected now (at least with this function as I haven't tried anything else at the time of writing this). However, I'm really wondering, as 0df3902 got rejected, how is this fixed? Cause you write that this commit was supposed to fix this problem.
Also something else that has to do with Github in general but I can't seem to find how to fix it. Do you know how I can have notifications appear in my ring bell in the top right corner? I have tried anything and I really can't make this work
I just forgot to commit some code in that commit, fixed in the next commit.
You can see settings by going to bell -> left bottom -> Manage notifications -> notification settings
Thanks a lot!
I have the following code which converts and integral type to a string (u8*):
The result is the expected result but when I use a template the result is not what I was expecting. It actually has a weird behavior where some numbers will get converted normally but some others will return "00" as the result. The full code for the template and the main function is the following: NOTE: Keep in mind that I suppose that you have "write, sys_write, exit, and mmap" from a previous issue, if not, tell me to give them to you.