Skip to main content
1 vote
1 answer
76 views

So I have the following code: float param1 = SOME_VALUE; switch (State) { case A: { foo(param1); break; } case B: { bar(); break; } case C:...
Kai Yin's user avatar
  • 11
Advice
2 votes
6 replies
113 views

Does anyone know if there is, in c++, any way to determine at runtime the cpu characteristics of the machine that compiled the code? For example, in gcc (which I'm using) the preprocessor variable ...
user3195869's user avatar
3 votes
2 answers
187 views

I have two functions counting the occurrences of a target char in the given input buffer. The functions vary only in how they communicate the result back to the caller; one returns the result and the ...
Devashish's user avatar
  • 193
Best practices
2 votes
10 replies
277 views

In C, when I pass a pointer to a function, the compiler always seems to assume that the data pointed to by that pointer might be continuously modified in another thread, even though in actual API ...
Moi5t's user avatar
  • 465
3 votes
5 answers
631 views

I'm talking from a language point of view in C or C++, where the compiler sees: return condition ? a : b; vs: if (condition) return a; else return b; I've tried in my code, and both of them ...
Zebrafish's user avatar
  • 16.3k
25 votes
2 answers
4k views

The C++ standard [dcl.attr.likelihood] says: [Note 2: Excessive usage of either of these attributes is liable to result in performance degradation. — end note] I’m trying to understand what “...
Artyom Fedosov's user avatar
0 votes
0 answers
43 views

Nodes: building a gcc_tree_node for a custom prograimming language compile and base on C++26 the modules are avilable the language using tab-block system every keyword start with '/' I want to ...
Adam Bekoudj's user avatar
5 votes
3 answers
291 views

I thought that the noinline function attribute would force the compiler to treat a local function as a black box: __attribute__((noinline)) void touch_noinline(int&) {} void touch_external(int&...
sh1's user avatar
  • 5,010

15 30 50 per page
1
2 3 4 5
227