408,144 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
0
votes
9
replies
110
views
How can I create a Linux Container in C?
I was looking for something fun to do in C and I saw this one post where someone made a Linux Container in C. Now, I didn't know much about containers (I've used a little bit of Docker before).
From ...
- reputation score 517
Score of 1
0 answers
89 views
Trying to implement SPI slave in PICO PIO
I am trying to implement an SPI slave in PICO PIO and have tried to follow instructions I've seen online, but to no avail
.pio_version 0
.program keyboard_input
keyboard_setup:
set pindirs, 1
...
- reputation score 61
Tooling
1
vote
4
replies
137
views
cant find arc and csky compilers
I’m looking for working versions of csky-gcc and arc-gcc (synopsys arc700) toolchains for Linux.
I’ve already tried building the csky compiler from GitHub, but the build process takes several hours ...
- reputation score 1
Advice
1
vote
5
replies
181
views
Weird Look in VS Code, the word "format:" shows up in my C code just after "printf()"
I wonder if anyone's seen this before? I don't recall toggling anything on or off, but I'm see in this when I type code in C:
{
printf(format:"this is NOT an error\n");
return (0);
}
...
- reputation score 1
Score of 3
1 answer
124 views
VS Code default run task doesn't work for MSYS2 MinGW
I installed MSYS2 UCRT tools for compiling C and C++. GCC and G++ work in the UCRT shell, but they don't work when I try to run a C program through VS Code.
I set UCRT shell as default terminal and as ...
Score of 2
0 answers
255 views
Read pdf symbols as char any different representation using C or C++ with no external libs [closed]
For educational purposes I want to read pdf with C/C++ without any external libs.
how can I read meaningful values so I can make my own PDF_related library?
I'm fine to read it as binary and convert ...
Score of -3
1 answer
86 views
Running second query from the fetch fails on MySQL [closed]
I'm trying to run the following procedure:
mysql_stmt_init();
mysql_stmt_prepare();
mysql_stmt_bind_param();
mysql_stmt_execute();
mysql_stmt_result_metadata();
mysql_stmt_bind_result();
...
- reputation score 6503
Score of 0
3 answers
284 views
What is the point of calling conventions in C?
What is the point of calling conventions in C or any other programing language, as they only control which parameter gets pushed to the stack first and who clears the stack?
Example:
__stdcall: ...
- reputation score 29
Score of 1
1 answer
129 views
How to create an overlay in XCB + C?
I found an example of a click through window using xlib.
The code in xlib was this;
XRectangle rect;
XserverRegion region = XFixesCreateRegion(display, &rect, 1);
XFixesSetWindowShapeRegion(...
Advice
1
vote
9
replies
242
views
Gcc vs Clang for low level systems programming: which is better and why?
Between GCC and Clang, which compiler is generally better for low-level programming (C/C++) and systems development, and why?
I’m not asking about performance benchmarks only, but about things like ...
Score of 3
2 answers
176 views
What do fgetc and fputc have to do that using fread or fwrite on a big block avoids
I am writing a toy dictionary-based compressor program that reads and writes one byte at a time with fgetc and fputc. Now perf doesn't say those calls are the bottleneck, but I suspect perf is blaming ...
Tooling
2
votes
10
replies
162
views
Get bitwidth of any _BitInt(x) (especially signed)?
So far i could only think that you can wrap an unsigned integer under -1, and use IMAX_BITS to count it. but if the macro takes in a signed _BitInt() than that wont work.
unsigned typeof(x) sadly is ...
- reputation score 1
Score of 0
1 answer
123 views
_kbhit() unusual behavior with Unicode codepage on Windows console
I'm setting a Windows console with code page UTF-8 (65001), but the results with _kbhit() are a bit erratic (described below), when inputting keys in the "Latin Supplement" range, and even ...
- reputation score 473
Score of 1
4 answers
172 views
How does xcb's screen_of_display function work?
The function goes like so;
xcb_screen_t *screen_of_display (xcb_connection_t *c, int screen){
xcb_screen_iterator_t iter;
iter = xcb_setup_roots_iterator (xcb_get_setup (c));
for (; iter....
Score of 4
2 answers
199 views
For restrict pointer `p`, the definition of Based-On Implies that given `int* n = p`, `&*n` is not based on `p`
The C99 standard draft n1256 says the following about restrict qualified pointers in 6.7.3.1p3, 6.7.3.1p4
3 In what follows, a pointer expression E is said to be based on object P if (at some ...
- reputation score 1067