gcc in cygwin: no .reloc section generated?
EXE files compiled with Visual Studio usually have a relocation section, aka .reloc. But files compiled with cygwin-gcc does not have one. Is there any way to force gcc to create one? -Wl,--relocatable...
View Articlescikit-learn/python3 on raspberry pi
I am trying to install http://scikit-learn.org/stable/index.html# on raspbmc. AND I would like to use python3. Since scikit-learn supports only python3 > 3.3, and pi comes with 3.2 I need to build...
View Articlelibpthread.so.0: error adding symbols: DSO missing from command line
When I'm compiling openvswitch-1.5.0, I've encountered the following compile error: gcc -Wstrict-prototypes -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security...
View ArticleBootloader in C won't compile
I am a newbie in writing bootloaders. I have written a helloworld bootloader in asm, and I am now trying to write one in C. I have written a helloworld bootloader in C, but I cannot compile it.This is...
View Articleqemu: uncaught target signal 11 (Segmentation fault) - core dumped, when...
I just noticed that I am unable to have a function return a struct. I am running this on ARM32/debian docker image with threads enabled.This is the function that gives me the run time error:struct...
View ArticleWhen I use gcc with -O1 optimization. Array data initialization is ignored...
Using gcc 7.4.0 and compiling this sample program with the -O1 optimization flag, the data being set inside of the array 'cap' is being optimized out leaving me with uninitialized data.#include...
View Articlestd::byte is not member of 'std'
I'm trying to learn new features/gimmicks of c++17, but then I got to std::byte and for some unknown reason I can't seem to be able to compile even most basic "hello world" type program with the...
View ArticleInterrogate the C compiler about data types when cross-compiling
I am working on a cross-platform project that uses GNU Autotools for the build system, and I was wondering if there is a way to run a simple sizeof(int) and pass the result to the configure script (or...
View ArticleOptimization of copying with an explicit byte order in arm-none-eabi-gcc
In writing part of a deserializer for a data structure in C, I needed a way to read 16-bit and 32-bit integers. Given that there is a possibility that this code may be compiled for and used on an...
View ArticleConditional move (cmov) in GCC compiler
I saw somewhere that the GCC compiler might prefer sometimes not using conditional mov when converting my code into ASM.What are the cases where it might choose to do something other than conditional mov?
View ArticleProgram executed on Cygwin does not report a thrown exception
When I run a simple program shown below, I get different terminal output on Cygwin and Ubuntu OS.#include <cstdio> #include <stdexcept> #include <cmath> using namespace std; double...
View ArticleGdb and dollars in identifiers
I'd like to debug a program that uses the dollars in identifiers extension.Take #include <stdio.h> int main() { int $a = 42, b= 43; printf("%d %d\n", $a, b); } for a simplified example. If I run...
View ArticleDoes the RVO is enable by default for C?
I want ot know if RVO is enable by default for C. I know that the "-fno-elide-constructors" flag is not enable for gcc but maybe I have a miss on this feature.Basically, I try to compile this two code...
View ArticleCompiler explorer and GCC have different outputs
I have some C code that when given to Compiler Explorer, it outputs: mov BYTE PTR [rbp-4], al mov eax, ecx mov BYTE PTR [rbp-8], al mov eax, edx mov BYTE PTR [rbp-12], al However if I use GCC or G++...
View ArticleSlow free() on Raspberry Pi
I am debugging a piece of audio software needing low latency yet depending on running free of xruns. I have reduced the problem to be in a call to free(). It is a fairly large block of data to be...
View ArticleGCC error No such file or directory when including a separate file
When I try to compile including the file stack.h my GCC gives me the error "No such file or directory"gcc -std=c99 -Wall -o Ou1 ou1.c -I C:\Users\NAME\Documents\C programmering\DOA\stack.h The code...
View ArticleGetting error when trying to run make on a github repo windows 10
When I try to compile this program, I get the following error, and I cannot find out how to resolve it.. I tried make -DCC=gcc I got this from another post when I tried googling the problem, but didn't...
View ArticleInitialization of inline static data
I am wondering how and when static inline data is initialized in C++ (for example in gcc or clang). I know it is a question specific to some architecture and it is not related to the C++ standard.I...
View ArticleEstimate memory usage C++ Ubuntu
I have a memory intensive application in which the following structs are created at some point.struct NeighborData { int flags; int id; }; struct Node { int id; std::vector<NeighborData>...
View Article__sync_bool_compare_and_swap - return value if oldval and newval are same
the documentation does not say what happens when the expected oldval and the newval is the same. Following is from the gcc doc:The “bool” version returns true if the comparison is successful and newval...
View Article