Why can't GCC's typeof() be stringified?
I'd like to print the type that typeof() outputs, but typeid is only available in C++. Why can't I use stringification to get the name of this type?#define GET_STRING(s) #s#define example(input) \ do {...
View ArticleBuilding 32b binary on 64b platform
The platform in question is Debian. I have installed: gcc-multilib g++-multilibHowever, I keep getting this error when linking:/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libcrypt.so...
View ArticleWhat does the fpermissive flag do?
I'm just wondering what the -fpermissive flag does in the g++ compiler? I am getting:error: taking address of temporary [-fpermissive]which I can solve by giving the -fpermissive flag to the compiler....
View ArticleWhere can I find GLIBCXX_3.4.29?
I updated my GCC compiler from the GIT repo to version 11. Now my test code (GoogleTest/GoogleMock) is complaining about GLIBCXX_3.4.29 not being found.This is not a duplicate please reopenThe answers...
View ArticleGetting error syntax error: unexpected "("When building a C program in Docker
I am trying to build a C program inside a Docker container, I just would like to create a binary file and execute it in the container. I receive no error during compilation butwhen running within my...
View Articleofstream is creating a file but writting only starting word not full string
This is My code. It makes a file but only prints he first word i input. Please help.std::string userinput;int a =rand() % 4+1;std::stringstream ss;ss << a;std::string line = ss.str();std::string...
View ArticleLinking Boost when using cmake-conan
Problem descriptionI am trying to have the following CMake project working: the idea is to use cmake-conan to have cmake handle the conan install step (sparing the user the need to set up the profile...
View ArticleHow to use __attribute__((fallthrough)) correctly in gcc
Code sample:int main(int argc, char **argv){ switch(argc) { case 0: argc = 5; __attribute__((fallthrough)); case 1: break; }}Using gcc 6.3.0, with -std=c11 only, this code gives a...
View ArticleGCC 7, -Wimplicit-fallthrough warnings, and portable way to clear them?
We are catching warnings from GCC 7 for implicit fall through in a switch statement. Previously, we cleared them under Clang (that's the reason for the comment seen below):g++ -DNDEBUG -g2 -O3...
View Articlecpp files not running in vs code [duplicate]
I was installing vscode from scratch and I went through the Microsoft docs for installing gcc and MinGW. I added path variable in system variables, but still I get this error:g++ : The term 'g++' is...
View ArticleEclipse CDT - how to use an argfile for the linker for a too long command line
I'm using Eclipse CDT 9 Neon with GCC 6.3 on Windows 7 for a STM32 project.I have installed the GNU ARM Plug-in and use sh.exe for long command line management (cmd.exe from windows have a limite of...
View ArticleARM crashing upon returning from a function
The device consists of an Cortex M4 main processor and an Cortex M0+ co-processor running the network stack.I've been trying to influence the bluetooth advertisement beacon behavior - when are they...
View Articlecannot open source file stdio.h C in vscode
I've been trying to learn C recently.When I execute the following code in visual studio code:#include <stdio.h>int main(){ // variable declaration int a, b, c; // user prompts printf("enter a...
View ArticleReplacement for Omagic flag?
When switching from using GCC to CLANG, for some reason including the -N/--omagic flag increases my .elf executable size by ~1000x, as the physical address of an init_array section that is otherwise...
View Articledlclose doesn't really unload shared object, no matter how many times it is...
My program uses dlopen to load a shared object and later dlclose to unload it. Sometimes this shared object is loaded once again. I noticed static variables are not re-initialized (something which is...
View Articlememcpy for volatile arrays in gcc C on x86?
I am using the C volatile keyword in combination with x86 memory ordering guarantees (writes are ordered with writes, and reads are ordered with reads) to implement a barrier-free message queue. Does...
View ArticleHow to Initalize Tread Local Storage in C
static __thread vars* ptr=NULL;void thread_init(vars* new_vars){ if(new_vars){ ptr=new_vars } printf("%p",ptr);}__thread is GCC's extentionthread1 is one thread of mainthread1_child is child of...
View Articlecharconv header not found gcc 12
I'm running Debian 9 on WSL 2 and I'm trying to compile C++ code that uses the <charconv> header. I have the line set(CMAKE_CXX_STANDARD 17) in my Cmake file so it's definitely using C++ 17 but...
View ArticleC++ syntax for explicit specialization of a template function in a template...
I have code which works in VC9 (Microsoft Visual C++ 2008 SP1) but not in GCC 4.2 (on Mac):struct tag {};template< typename T >struct C{ template< typename Tag > void f( T ); // declaration...
View ArticleInstalled gcc 12.1.0 in /usr/local/bin and now ubuntu cannot find and point...
I have tried all the solutions of similar questions and none works.I have installed gcc in /usr/local/bin and this my PATH variableecho...
View Article