7 questions from the last 7 days
0
votes
1
answer
214
views
Why __FILE__ does not print the full path (even with gcc)
I am writing a logging utility in C and want __FILE__ to print the full absolute path to the source file:
/home/j/OSL/Separate.c
But it still prints a relative path:
../Separate.c
even though I am ...
0
votes
1
answer
48
views
GCC+CMake, static lib changes size_t footprint
While refactoring some legacy code I ran into some strange behaviour of CMake+GCC that I can not explain or correct.
This is what I have:
Debian Trixie with GCC 14.2.0 and CMake 3.31.6
A test project ...
0
votes
0
answers
90
views
Linkage error using STD on Windows GCC 15.2.0
I follow How to use module `std` with gcc to generate "gcm.cache/std.gcm" on Windows using GCC 15.2.0 and ran g++ -std=c++23 -fmodules -fsearch-include-path -c bits/std.cc at "C:\bak\...
1
vote
0
answers
38
views
x86: How to obtain return address from %ebp?
Similar question: Assembly return address
I want to write a function to print the return address of the current function. This is code that prints %ebp+4:
void backtrace() {
int ebp;
asm ("movl %%...
0
votes
0
answers
28
views
C++20 modules with GCC and Clang/Eclipse CDT LSP Editor
My project defines a module ocr, imports std and includes headers from a few libraries, for example:
module;
#include <httplib.h>
#include <tesseract/baseapi.h>
#include <leptonica/...
1
vote
0
answers
86
views
How do I configure VSCode IntelliSense to use my local GCC trunk build?
I have built GCC 16.0 trunk in order to test out the new C++26 reflection capabilities. I am developing using WSL (Ubuntu) and VSCode.
As it stands, I have the following basic example in a simple ...
1
vote
0
answers
35
views
Inline Assembly Bug in gcc? [duplicate]
The code in question
void _start() {
const char msg[] = "Hello, World!\n";
long ret;
__asm__ volatile (
"mov $1, %%rax\n"
"mov $1, %%rdi\n"
...