Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Not a kata issue, I've just submitted a solution in C. Remember to cast to the right type during computation
If it bothers you, you are most likely writing wrong code. The point of doing this is to prevent careless users who assume the memory to be zeroed (a common culprit is the first call to
strcat()
), or who forget to nul-terminate their strings, to pass the tests when they should not. In general, you should treat output parameters as if they could initially contain anything, unless the function's documentation says otherwise.I gave up in the end! I wanted to see the solutions! Haha, I thought I was looking at the right calling convention, but apparently not.
I can both confirm that the submitted solutions still work, and confirm that it's normal if you're not finding arguments on the stack!
You might want to make sure you're reading about the actual Linux calling convention on x86-64, not 32-bit/i386 calling convention. The correct one is also known by other names like 'System-V AMD64 psABI'.
Edit: Looks like you solved it already. Well, I guess it's a tip for future readers.
Ahhh thankyou! I'll use that in the future. Is it possible to get previous solutions from the challenge?
Could you post your original solution with a spoiler flag here? In general, you can always use https://c.godbolt.org/ to see the generated assembly.
This comment is hidden because it contains spoiler information about the solution
The C compiler on Codewars follows the Linux calling convention. I recommend to solve some NASM katas to understand this convention.
Submitted solutions still work and there are no major issues with tests.
Can someone confirm if this works or not? I'm using attribute((noinline, optnone)) on my function and still there are no arguments in the stack. Does this Kata even work anymore? Or has it been broken with an update of the servers or something? I don't mind carrying on, but if the arguments aren't there in the call stack, where on earth are they? And how are we supposed to know where to find them?
I agree that this should be higher than 4kyu. I have also learned a lot, but it seems like this problem is damn near uncompletable now. Has something changed? I'm printing everything in the call stack and I'm getting no extra arguments. Where would they be stored if they're not on the stack?
I'm reading the call stack for the arguments, but I can't see them anywhere. Is codewars definitely following the Linux calling convention?
I can pass all the tests, and my attempt take 7ms, but I'm getting numbers way too big for unsigned long long. Has anyone else had this problem?
Good job on solving it by yourself! I'll mark the question as resolved.
This code is really tight and pretty. What's your strategy for making your code look so nice? Do you follow any rules or principles?
Loading more items...