How to compile without warnings being treated as errors?
The problem is that the same code that compiles well on Windows, is unable to compile on Ubuntu. Every time I get this error:cc1: warnings being treated as errors Now, it's big code base and I don't...
View ArticleHow to install git and gcc-c++ through Dockerfile?
I have CentOS VM on which I have installed git and gcc-c++ using CentOS Linux commands:sudo yum install git sudo yum install gcc-c++ and everything works smoothly now I want to do this through...
View ArticleLinker optimizing out shared library
Using CMake and gcc/clang compilers I want to create a shared library out of this file (Registrator.cpp):#include ... namespace { struct Registrator { Registrator() { ... } ~Registrator() { ... } }...
View ArticleIs binary operator '+' a sequence point in C? [duplicate]
I have the following code:#include <stdio.h> int main() { int a = 2, c; c = a++ + a; printf("%d\n", c); // prints: 5 } I thought this would print 4 because the side effect of ++ shouldn't...
View ArticleWhy does adding inline assembly comments cause such radical change in GCC's...
So, I had this code:constexpr unsigned N = 1000; void f1(char* sum, char* a, char* b) { for(int i = 0; i < N; ++i) { sum[i] = a[i] + b[i]; } } void f2(char* sum, char* a, char* b) { char* end = sum...
View ArticleUnable to compile a C GTK app using GCC on Windows
I have installed GTK on my Windows machine an am attempting to compile a C program with GTK using GCC. I am using MSYS.I have used pkg-config to get all of the relevant flags and dependencies text for...
View ArticlePyDStool package, symbol table not found
I am trying to use the PyDStool for bifurcation analysis. I have followed the installation instructions here, https://pydstool.github.io/PyDSTool/GettingStarted.html. I am on windows 10 and using...
View ArticleGCC extended inline assembly - "invalid instruction suffix for mov"
I try to understand how the extended inline assembly in GCC works. But when I try to run a simple test program I get the error: "invalid instruction suffix for mov"The sample program:unsigned char...
View Articlegdb setup: no acceptable C compiler found in $PATH
So I'm on Windows 10 in the Ubuntu Linux subsystem, and I'm trying to run the configure script for gdb. My c: drive looks like this:C: |_gdb-9.1 -> folder with the gdb files |_gdbBuild -> folder...
View ArticleSelection sort sorting incorrectly
I was writing a selection sort, and it's not sorting properly, sometimes it works, but most of the time there is one or two numbers out of place. It's supposed to print an array of numbers, sort those...
View ArticleLinkedList Segmentation Fault [closed]
This LinkedList Checkbook program I wrote keeps getting a segmentation fault, and won't display the dates of my checks? I've been trying to debug but can't find the spot where I made a mistake. The...
View ArticleHow to place multiple const objects from multiple translation units sorted in...
I am developing firmware for some devices and each of them contain configuration objects which values are allowed to be changed by an external application. Here is example of such object:struct...
View ArticleWhy am I getting a "duplicate symbol" error for my functions in C?
I have three C files, main.c, function1.c, and function2.c. I compile them using gcc -o main main.c function1.c function2.c. I have a helper function helper() defined in function1.c. So function1.c...
View ArticleI use valgrind-3.8.1 on c++ program, it points out some errors on gcc [closed]
==20628== Conditional jump or move depends on uninitialised value(s) 8 ==20628== at 0x4019054: ??? (in /home/opt/compiler/gcc-8.2/gcc-8.2/lib/ld-2.21.so) 9 ==20628== by 0x4007EF3: ??? (in...
View ArticleHow does C compiler `-O0` make code go so crazy?
Please take a look at: https://godbolt.org/z/WGBP8DCode: size_t n; scanf("%d", &n); fprintf(stderr, "(1 <= %d) == %d\n", n, 1 <= n); fprintf(stderr, "(%d <= 1000) == %d\n", n, n <=...
View ArticleWhy isn't gcc recognizing my .c file even when I provide it as an argument?
I have file1.c:#include <stdio.h> int main() { file2(); } and file2.c:#include <stdio.h> int file2() { } I'm trying to compile file1 with gcc -o file1 file1.c file2.c, but I'm getting the...
View Articlesetup script exited with error: command 'x86_64-linux-gnu-gcc' failed with...
When I try to install odoo-server, I got the following error: error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Could anyone help me to solve this issue?
View ArticleComparing a bit to a boolean
Say I have a set of flags, encoded in a uint16_t flags. For example, AMAZING_FLAG = 0x02. Now, I have a function. This function needs to check if I want to change the flag, because if I want to do...
View Articleconfigure CXXFLAGS refuses to accept more than one include path
I am trying to build a project that requires two include paths. My command is: ./autogen.sh --prefix /usr/ --libdir /usr/lib/x86_64-linux-gnu/ CXXFLAGS="-I${TensorflowPath}...
View ArticleFindOpenMP failed on setting OpenMP_pthread_LIBRARY on alpine
I was trying to build a multi-threading application with cmake in my container. It failed when I tried to find OpenMP 3.0 with FindOpenMP, but worked fine if FindOpenMP was removed. Here is my...
View Article