Skip to main content
5 votes
0 answers
227 views

I am writing an embedded OS to run on Risc-V. As part of that, I'm implementing a FIFO for UART buffering using the classic single consumer/single producer module. The class looks like this: template &...
Shachar Shemesh's user avatar
1 vote
2 answers
310 views

So there is a phrase from the C++ Standard working draft (n4928): [dcl.init.general] ¶ 16.6.1 If the initializer expression is a prvalue and the cv-unqualified version of the source type is the same ...
Eugene Zavidovsky's user avatar
0 votes
0 answers
45 views

I'm very very new to C++ so I hope this question does make sense and is not too ill formed. From my understanding, the uniform initialization {} should forbid any narrowing conversion. So for example ...
Pickman02's user avatar
  • 101
0 votes
1 answer
100 views

I'm using video_player: ^2.10.0 to display a video as a background in my web app, but it is simply not loading. There is this Video init error: UnimplementedError: init() has not been implemented. I ...
Mian Faseeh's user avatar
0 votes
1 answer
28 views

I have a script in Gtree with GAMS on the carry-over effect on groundwater. I initialised the groundwater depth in the year 2000, and then I need to use the end-of-the-year groundwater depth as a ...
Thomas's user avatar
  • 501
9 votes
4 answers
1k views

I used malloc to define an index because each line had a different number of elements (simplified example below): int** Index=malloc(2*sizeof(int*)); Index[0]=malloc(2*sizeof(int)); Index[1]=malloc(3*...
Anonymus Anonyma's user avatar
5 votes
2 answers
388 views

Consider this code: int foo() { goto lbl; int a = 4; lbl: return 5; } With GCC 12, this compiles totally fine as C, not even a warning. However if I try to compile it as C++ I get this ...
Timmmm's user avatar
  • 99.2k
3 votes
2 answers
225 views

C++26 introduces "erroneous behaviour" for uninitialised data, and introduces the [[indeterminate]] attribute for locals to restore the pre-C++26 behaviour as needed. I want to get ...
sh1's user avatar
  • 5,010
0 votes
0 answers
100 views

I’m trying to understand the rationale behind the Linux kernel’s initcall mechanism. My current understanding: Kernel subsystems expose one-time initialization functions using macros like ...
void_brain's user avatar
2 votes
1 answer
117 views

I would like to initialize a NULL terminated array of pointer to struct using compound literals. Currently, I achieve this by: struct object { int data1; char data2; }; struct object *...
WalrusDevil's user avatar
2 votes
1 answer
99 views

While reviewing some testing code, I have come across this situation: Suppose we have these two classes: class Project { public: Project(std::string path); ~Project; // [many more ...
perivesta's user avatar
  • 4,178
0 votes
0 answers
50 views

I am new to Pytest and Python. I tried to run some test with Pytest but I got this error: OS: Windows 11 Home Python version:3.13.5 Pytest version:8.4.1 The command I tried to run is PS C:\Users\xxxx\...
user30965980's user avatar
1 vote
3 answers
210 views

In C++, how can one programmatically determine whether an object is default-initialized or left uninitialized — without relying on reading the standard, documentation, or source code? For example: int ...
toliveira's user avatar
  • 1,857
2 votes
1 answer
136 views

I have this record: record Foo { string _bar = "initialized"; public string Bar => _bar; } I'm running the following code: var foo = new Foo(); Console.WriteLine(foo?.Bar ?? &...
Ivan Petrov's user avatar
  • 7,389
5 votes
1 answer
124 views

Consider this code: int x[1] = {[0] = 1, [0] = 2}; Which value x[0] has? Experimentally the last designator takes effect (i.e. x[0] has value 2). However, does the C standard prescribe that "the ...
pmor's user avatar
  • 6,757

15 30 50 per page
1
2 3 4 5
789