Skip to main content
3 votes
2 answers
120 views

According to documentation, under /kernel mode: You must explicitly define the new() or delete() operator. The compiler and runtime don't supply a default definition. Yet, the following code ...
One_Cable5781's user avatar
1 vote
1 answer
103 views

I'm trying to set up such a minimal project using the library, but no matter what I try I can't import it: #include <iostream> #include "absl/time/clock.h" int main() { std::cout ...
Petr's user avatar
  • 63.6k
-2 votes
4 answers
207 views

I have a case where I have a bitfield that I know starts off as all zeros. And then I then I have something like: if (isTrue) bitfield |= flag; And what I wanted to do was to set it without ...
Zebrafish's user avatar
  • 16.3k
4 votes
0 answers
412 views

I've been investigating the assembly output for a simple C++ loop involving a const array and const size, and I've encountered peculiar version-specific behavior with GCC on Compiler Explorer. My ...
BullRMachineR's user avatar
2 votes
1 answer
182 views

How can I get clang or compiler explorer to emit information about its internal calculated branch probabilities for a snippet of C++ code? It's OK if it's in IR at some optimization pass and not in ...
BeeOnRope's user avatar
  • 66.3k
0 votes
1 answer
125 views

I'm not a Nim user, but I was astonished by how the solution for this exercise on Exercism. The text of the exercise is as follows: Your task is to convert a number into its corresponding raindrop ...
Enlico's user avatar
  • 30.3k
2 votes
1 answer
85 views

When I compile a single file in Compiler Explorer I can see all the constants like string literals in the output window. const char* ss = "abcdef"; E.g. here https://godbolt.org/z/hEzTG7d7c ...
Mikhail's user avatar
  • 22.1k
1 vote
0 answers
81 views

I would like to do some (micro)benchmarking in Swift. I have been using package-benchmark for this. It comes with a blackHole helper function that forces the compiler to assume that a variable is read ...
loonatick's user avatar
  • 1,197
3 votes
1 answer
236 views

I'm exploring some disassembled C programs with godbolt and I am having trouble wrapping my head around the x86_64 "call" instruction. With the C code: int func(int i) { return i + 1; } ...
BatterySoda's user avatar
0 votes
1 answer
101 views

I have this source code: #include <iostream> #include <cstdint> #include <cstring> struct bt_data { uint8_t type; uint8_t data_len; const uint8_t* data; }; static const char* ...
Maximilian Matthé's user avatar
2 votes
0 answers
108 views

In godbolt compiler explorer (https://godbolt.org/z/Gqc5PeKz8) I am passing a single argument which contains spaces inside quotes, but it looks they are getting treated as separate arguments: #include ...
Harry's user avatar
  • 4,146
2 votes
1 answer
105 views

If I compile the following with -O3 #include <vector> int foo() { std::vector<int> const v{17,2,3}; return v[0] + v[2]; } the assembly I get is foo(): mov eax, 20 ...
Enlico's user avatar
  • 30.3k
5 votes
0 answers
3k views

If I compile a piece of code that writes to the console I can't see anything, only the assembly code on the right. Link. How I can I see what's printed from a call to std::cout?
Zebrafish's user avatar
  • 16.3k
3 votes
1 answer
240 views

On Godbolt, this executes fine: volatile __m512i v = _mm512_set_epi64(1, 0, 0, 0, 0, 0, 0, 0); but all zeros does not: volatile __m512i v = _mm512_set_epi64(0, 0, 0, 0, 0, 0, 0, 0); It ...
user997112's user avatar
  • 31.1k
0 votes
1 answer
90 views

I faced the unresolved symbol linker error regarding a static member of a class. I have found this and some other threads which learned me, that I have to declare an instance of the static member ...
jokn's user avatar
  • 170

15 30 50 per page
1
2 3 4 5