Questions tagged [godbolt]
18 questions
0
votes
2 answers
Why the assembly output of a compiled rust code does not include any asm instructions?
I wrote this snippet in the compiler explorer:
fn foo() -> u8 {
54
}
fn bar() -> u128 {
3423
}
fn main() {
let a: (u8, u128) = (foo(), bar());
println!("foo result: {}", a.0);
println!("bar result: {}", a.1);
}
The…

Amir reza Riahi
- 1,540
- 2
- 8
- 34
0
votes
0 answers
Why does this call to IntRange.random() in Kotlin cause a stack overflow on godbolt?
Does anybody know why this simple code is causing a stack overflow in godbolt?
import java.util.Random
fun main()
{
val randomNumber = (1..6).random()
}
Here it is in action on godbolt using Kotlin 1.6.10. I get the same error whether…

yano
- 4,827
- 2
- 23
- 35
-1
votes
1 answer
Compare goldbolt and MSVC C++ version
I have written some code that compiles on godbolt, but does not compile in Microsoft Visual Studio. I am trying to figure out why. My first step was to compare compiler versions. On goldbolt, I am compiling the code using "x64 msvc v19.latest." I…

Mark Wallace
- 528
- 2
- 12