What exactly does `-rdynamic` do and when exactly is it needed?
What exactly does -rdynamic (or --export-dynamic at the linker level) do and how does it relate to symbol visibility as defined by the -fvisibility* flags or visibility pragmas and __attribute__s?For...
View ArticleWhy do c++ standard library template class functions say undefined reference...
When using <fstream> with g++ -D_GLIBCXX_HAVE__WFOPEN=1 -D_GLIBCXX_USE_WCHAR_T=1(msys2 gcc 13.3.0) it throws an error/usr/lib/gcc/x86_64-pc-msys/13.3.0/../../../../x86_64-pc-msys/bin/ld:...
View ArticleIncorrect `cast-align` warnings on GCC and Clang even with...
BackgroundI have a struct with a flexible array member, which I am using to store arbitrarily-sized data inline (for a generic linked list for any element type), and I can simply cast data to T* to...
View ArticleFind location of tcl/tk header files
I'm trying to find a cross-platform way to find tcl.h and tk.h without having to search the entire system. I'm just wondering if there's a way to find this from Tcl or tkinter?...
View ArticleHow to make C++ be as economical with memory as C, while still using STL?
These C and C++ programs are equivalent:"loop.c":#include <stdlib.h>#include <stdio.h>#include <math.h>const int N = 1024*4;int main(void) { double* v = malloc(N * sizeof(double));...
View ArticleHow realloc works passed 0 size as argument
How realloc works passed 0 size as argument?from man page:Unless ptr is NULL, it must havebeen returned by an earlier call to malloc(), calloc(), or realloc().Why it needs to be?compile this with gcc...
View ArticleWhat is the reason of general protection fault due to GDT selector 1113 in my...
I am developing a x86 architecture based 64 bit Operating System which is using limine-8.6.0 bootloader. I have enabled GDT byglobal gdt_flushgdt_flush: LGDT [RDI] jmp reloadSegments RETglobal...
View ArticleInvalid pointer own get_next_line implementation
In the last reading of the file, when it still has to return a line, and the line variable has the content of that line, an invalid pointer error occurs when doing free in the main but that line has...
View ArticleTWS API Linux - Segmentation fault - __bid64_to_string
Running Cpp sample client out of the box.I receive a segmentation fault.0x00005555555efba6 in __bid64_to_string ()Have sourced this function to client file to Decimal.hextern "C" void...
View Articleerror: unknown type name ‘max_align_t’ when building GCC 14.2 for centos7
I am building gcc 14.2.0 from source for centos7 and ran into the following issue with gettext during the make process. I plan to use the recent C++ compilers that comes with gcc 14.gcc -std=gnu99...
View Articlecannot open source file "glibconfig.h" (dependency of "gtk/gtk.h") in Studio...
I've configured the task json in Visual Studio Code{"tasks": [ {"type": "shell","label": "gcc build active file","command": "/usr/lib64/ccache/gcc","args":...
View Articleversion-depending gcc build error: multiple definition of `g_common' [duplicate]
I am upgrading crosstools from gcc-7.5.0 to gcc 11.4.0.Using gcc 7.5.0, below source files can be built successfully.But using gcc 11.4.0, linking errors...
View ArticleHow do I best silence a warning about unused variables?
I have a cross platform application and in a few of my functions not all the values passed to functions are utilised. Hence I get a warning from GCC telling me that there are unused variables.What...
View ArticlePurpose of __USE_XOPEN2K8 and how to set it?
I'm trying to compile the gtk stack (the last gtk2 version, 2.24), and I am getting a bunch of errors that seem related. Namely, the __locale_t can't be found from string.h and time.h, and LC_ALL_MASK...
View Articleflipperzero ufbt launch gives me errors. --gc-sections requires a defined...
I'm using Visual Code (Version 1.87.0) to create a basic hello world app. When I run ufbt launch I get the following error. I have tried UFBT update to make sure I have the latest stable version. I...
View ArticleDoes a compiler flag exists to warn if multiple files with the same name for...
Recently I run into the following problem:A source file included a header with a non unique file name.The build suceeds if the Include paths are given in the correct order.I would like to be warned at...
View ArticleDebugger fails to show return value of function taking vector in C++
I've this C++ program, when I run the debugger it fails to show the return value of the f1.#include <iostream>#include <vector>#include <string>using namespace std;string...
View Articlebuilding nodejs from source failed: cannot convert std::vector to const char *
OS: ubuntu 24.10GCC: 14.2.0node: node-v20.9.0 from herePython: 3.11.0building processPATH=/usr/local/Python-3.11.0/bin:$PATH ./configure --prefix=/usr/local/node-v20.9.0make -j 64build options...
View ArticleCan ARMCC generate a warning for implicit conversion?
I am trying to find the armcc equivalent of the gcc option that generate a warning if there is a sign mismatch when passing in integers into a function.In gcc, these compiler options will generate an...
View ArticleIn C++ is there a portable way to make uncacheable memory accesses?
I'm writing a microbenchmark to generate traffic to main memory (DRAM) using c++ and g++. I know I can inline assembly to create uncacheable accesses. However, I want this to operate on multiple...
View Article