Is there a way to to to get the enum type of a value in GCC tree structure?
I'm writing a GCC plugin for GCC 9 and I've got the following problem:Imagine a simple initialisation:enum en{ENUM_VAL1, ENUM_VAL2, ...};int a = ENUM_VAL1;What I would like it to be able to do is...
View ArticleIs there a gfortran equivalent to gcc's __attribute__((section("name")))?
I am using the nestedvm package, which includes a patched Gnu gcc compiler. For this package, callable user methods/functions have to annotated with __attribute__((section(".text"))), as shown in the C...
View ArticlePIC performance in static libraries
I'm using yaml-cpp library, which by default generates position dependent static library (libyaml-cpp.a). My own library compiles into two versions, static and shared. Since I need shared one, I have...
View Articleg++: error: unrecognized '-std=c++17' (what is g++ version and how to install)
I am working on RHEL 7.5 and trying to compile a uWebSocket (This exaple) code. I clone the project and open it. When I start make on Makefile I got this error;BroadcastingEchoServer uSockets/*.o -lz;...
View ArticleGcc compiled executables produces "access denied" message?
I have set path to the gcc inside the dev-c . It compiles fine and creates the executable but it fails to run the program and shows a message box (as shown in the first picture) first and then prints...
View Articlebootstrap building gcc - stage 2 and 3 comparison fail
rm -f stage_current make[3]: Leaving directory /d/Projects/compiler/gcc-build' Comparing stages 2 and 3 warning: gcc/cc1-checksum.o differs warning: gcc/cc1plus-checksum.o differs Bootstrap comparison...
View ArticleGCOV Version mismatch - expected 700e got 408R
On one server with GCC 4.4.7/GCOV 4.4.7, I'm able to run the tests successfully. However on a different server with GCC 4.8.5/GCOV 4.8.5, running the tests results in this...
View ArticleSwitch GCC version with HomeBrew
I have used brew to install gcc9 (gcc@9), but the default gccversion is still the old one:$ gcc --version gcc (Homebrew GCC 5.5.0_7) 5.5.0 When I look into Homebrew/bin, I find:c++ -> g++ c++-5...
View ArticleHow to use -Werror= to make compiler throw errors for all...
I am not sure what should go on the right side of the equal sign for:-Werror=<what_should_go_here?> Should it be-Werror=implicit-int-conversion or-Werror=-Wimplicit-int-conversion or something else?
View ArticleError when I compile 'hello-world' example from Contiki
I have installed the Contiki OS sources, and the ARM GCC compiler by doing brew install arm-none-eabi-gcc. However, when I try to run the hello world example in Contiki's example folder using the...
View ArticleMingw64 / Msys2 - gcc unable to find headers in its own include dir
I recently installed MSYS2 following Steely Wing's answer on this thread: How to install MinGW-w64 and MSYS2?The final goal is to compile a project on Windows in order to create an executable that I...
View ArticleCan't install reticulate in R
I'm trying to install reticulate so I can execute some Python code I've written from within R. Unfortunately, I'm having trouble installing the package and haven't had much luck in determining the...
View ArticleC++17 testing for data-member SFINAE: gcc vs clang
I have simple code snippet where I'm trying to test for a data-member:#include <type_traits> template< typename T0 > using is_data_member = std::bool_constant< std::is_same_v<...
View ArticleGet return value of Linux syscall with GCC inline assembly
The following macro can perform the lstat system call.#include <stdint.h> #define m_lstat(PATH, FS){ \ long _rax = 6; /*sys_newlstat*/ \ uint8_t* _path = PATH; \ struct stat* _fs = FS; \ asm...
View ArticleWhat does the gcc warning "project parameter passing for X changed in GCC...
I have a C++ project that builds fine and without warnings with gcc 7.2 on x86 Linux and Windows, I needed to port it to an ARM device so I tried to crosscompile it with an "arm-linux-gnueabihf" gcc...
View ArticleHow does the cout statement affect the O/P of the code written?
#include <iostream> #include <iomanip> #include <math.h> using namespace std; int main() { int t; double n; cin>>t; while(t--) { cin>>n; double x; for(int...
View ArticleHow to add a default include path for GCC in Linux?
I'd like gcc to include files from $HOME/include in addition to the usual include directories, but there doesn't seem to be an analogue to $LD_LIBRARY_PATH.I know I can just add the include directory...
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 ArticleCompiling with optimization gets a condition wrong
This piece of code has a bug in the loop termination condition. However, I still don't understand the compiler's decision - it seems to be getting into the loop one more time.#include <stdio.h>...
View ArticleUnable to see elements of std::vector with gcc in VS code
I'm currently using VS Code to learn C++ because it was easy to setup and is much lighter than VS Studio. However, one thing that I'm unable to do is to see the elements of an array (or string, etc),...
View Article