How to compile PicoTCP minimal example on Windows
I was trying use picoTCP on Windows. I was following the how to compile on Windows from here. This compiled the library successfully with only notes of usleep being deprecated. The next step was to use...
View ArticleInstall gcc offline Ubuntu
I got an offline Ubuntu 20.04. I wanted to use curl, but it wasn't installed. Trying to install it, needs binutils; tried to install binutils, needs make, tried to install make, needs...gcc!I seriously...
View Articlegcc-11 compiler giving error though it is already installed [closed]
I tried to compile yo.cpp file from terminal but it is giving this error on my macbook monterey air intel. I have already installed gcc-11. The file is compiling when Iuse clang compiler.Undefined...
View ArticleWhy strrev() in C is not working with char*?
Using C programming, with GCC in windows (with CodeBlocks)Why this code doesn't work (running it gives empty console window)# include <stdio.h># include <string.h>int main(){ char* str =...
View ArticleHow can I determine what architectures gcc supports?
GCC supports a -march switch that allows you to specify the architecture you are targeting - allowing it to tune instruction sequences for that platform as well as using instructions that might be...
View Articlearm-none-eabi toolchain compile from source
For my current project we are having an issue which we can solve if we are able to recompile the arm toolchain (gcc, c++stdlib, nanolibc, etc) from source.From the arm website I can download a snapshot...
View ArticleR3 register of ARM-Cortex M4F suddenly changes value right after ldr instruction
I have this really strange bug where an ldr instruction first loads in a valid value into the R3 register, then when I use the debugger to step over one instruction, it all of a sudden contains the...
View ArticleHow to write math library in C on ubuntu in VS code studio [closed]
I am just learning C and get an error. After searching on Google, I find out math.h does not work on Ubuntu using VScode. How can I see the result of math.h?
View ArticleHow to fix error or warning in C: "implicit declaration of function...
I am unable to use inet_aton() to convert an ASCII IP address such as "192.168.0.1" to a struct in_addr address in network byte order because I cannot get my code to compile.I'm working in this file:...
View ArticleDoes GCC optimize assembly source file?
I can use GCC to convert assembly code files into reallocatable files.gcc -c source.S -o object.o -O2Is the optimization option effective? Can I expect GCC to optimize my assembly code?
View Articlemultiple definition of `std::__detail::__clp2(unsigned int)', gcc-linaro
I am using gcc-linaro-12.0.1-2022.02-x86_64_arm-linux-gnueabihf arm toolchain.I could not figure out why I am getting multiple definition of standard __clp2 function. I have checked include guards in...
View ArticleWhy the syntax of linking symbols is error
I used arm-none-eabi-ld (GNU ld (2.34-4ubuntu1+13ubuntu1) 2.34) with --just-symbols=symbolfile which includes following symbols.a =0x00000050;b =0x00000054;c =0x00000058;d =0x00001000;e =0x00001004;f...
View ArticleWhy is this code using strlen heavily 6.5x slower with GCC optimizations...
I wanted to benchmark glibc's strlen function for some reason and found out it apparently performs much slower with optimizations enabled in GCC and I have no idea why.Here's my code:#include...
View ArticleHow do I temporarily disable a macro expansion in C/C++?
For some reason I need to temporarily disable some macros in a header file and the #undef MACRONAME will make the code compile but it will undef the existing macro.Is there a way of just disabling it?...
View ArticleGcc -g What happens?
The assembly file is obtained by using gcc -g -S, and the part of .s file is as follows:.L3: .loc 1 22 11 mov eax, DWORD PTR -12[rbp] mov edx, eax mov rcx, QWORD PTR .refptr._ZSt4cout[rip] call...
View ArticleInstalling g++ = 7.5.0 with support for Cilk Plus
I want to use https://github.com/yushangdi/parChain however I can't fullfil requirement:Compiler:g++ = 7.5.0 with support for Cilk PlusI have a problem with installing GCC with Cilk. I try to follow...
View ArticleWhy `memmove` function has significant difference in two different computers?
I've tried to run the following C code from two different computers.#include <string.h>int a[100000];int main(){ for(int sz = 100000; sz > 1; sz --){ memmove(a, a+1, 4*(sz - 1)); }}Computer A...
View ArticleSOLVED - boost::adaptor::filter segfault with compiler optimisations
I have some weird behaviours when using boost::adaptors::filter. Let's note that I created a small example that respects my larger project contraints. With the following short example I have a segfault...
View ArticleUsing clang-11 to cross compile for aarch64-linux-gnu on x86-64 error:...
I am trying to use clang-11 to cross compile a c++ file to aarch-linux-gnu, from my host machine which is x86-64.Here's the command :clang-11 -v -target aarch64-linux-gnu -B/usr/aarch64-linux-gnu/lib...
View ArticleLinux-ftrace: why code profiling is achieved through mcount function (gcc...
With this question I aim to do a survey about instrumentation techniques used by linux ftrace.According with ftrace.txt:If CONFIG_DYNAMIC_FTRACE is set, the system will run withvirtually no overhead...
View Article