GCC flag to ignore instruction dependencies
I am trying to decompile a piece of code and apparently gcc prefers less complicated instructions over the more complex ones. After reading this answer I suspect it's because gcc is trying to reduce...
View ArticleProfile Guided Optimization - __gcov
I am trying to run profile guided optimization on my code with -fprofile-generate flag. When I compile with it, I am getting the following error.obj\Debug\main.o||In function...
View ArticleCompound literal and designated initializer warning from GCC but not Clang
Compiling with gcc -std=c99 -Wextra this piece of code:#include <stdio.h>struct T { int a; int *b; int c;};int main(void){ struct T t = {.b = ((int []){1, 1})}; printf("%d\n", t.b[1]); return...
View ArticleExceptions are not caught in a secondary thread, causing segfault
I cross-compile for a MIPS-based platform. The following code causes segfault, backtrace leads to __cxa_throw:#include <cstdio>#include <exception>#include <thread>#include...
View ArticleHow to generate core dump on AddressSanitizer error
I compiled my code like this to enable Asan:g++ -O0 -g -fsanitize=address -fno-omit-frame-pointerbut it never generates a core dump so that I can later examine the details of the error. How can I...
View ArticleSTM32H7 + external SDRAM - memcpy with length 3 crashes - word boundaries,...
I have a project running on an STM32H753ieval board with heap in external memory, with freeRTOS, modelled on the STM32 cube demos.At the moment the MPU and cache are not enabled. (as far as I can tell,...
View ArticleHow to specify Win32 as output when invoking GCC using MinGW on Windows
How to specify Win32 as output when invoking GCC using MinGW on Windows.Below I've posted my source code. My objective is to interface assembly with C code and produce an executable.I start assembling...
View ArticleGcc objcopy get reasonable size binary
I am trying to create a binary from elf file with PPC GCC, I understand the the objcopy will create the whole area for the memory sections. here is my sample ld file: MEMORY { RESETWORD: ORIGIN =...
View ArticleHow to fix the "implicit declaration of _open" error when building gcc from...
I am building gcc-10.1 on my 64bit Windows 10 system but I get this error:c:/users/gcc/libiberty/pex-win32.c: In function ‘pex_win32_open_read’:c:/users/gcc/libiberty/pex-win32.c:121:10: warning:...
View ArticleR Archived Package "OC" (Optimal Classification) Installation Failed Due to...
EDIT: My OS is 10.15.4 and R is 4.0.0 and Xcode 11.4.1I tried to install an archived package "OC" (Optimal Classification). I downloaded the file from here (oc_1.01.tar.gz) first and store it on my...
View ArticleWriting plugin like sub-applications for bare metal devices
I want to write an application for ARM microcontroller (Cortex-M) which should be able to load a part of code (text) from external sources and execute it when needed.An example of this would be writing...
View ArticleGcc error: gcc: error trying to exec 'cc1': execvp: No such file or directory
I have been successfully using gcc on Linux Mint 12. Now I am getting an error. I have recently been doing some .so builds and installed Clang not to long ago, but have successfully compiled since both...
View ArticleHow to call gettimeofday syscall in inline assembly in FreeBSD?
I am trying to get the current time using syscalls and inline assembly in FreeBSD 5.2.1 32-bit.My problem is that I struggle to pass needed structs as arguments to the function resulting in...
View ArticleCMPXCHG16B correct?
This doesn't exactly seem to be right although I am unsure why.Advice would be great as the documentation for CMPXCHG16B is pretty minimal (I don't own any intel manuals...)template<>inline bool...
View ArticleHow to declare 16-bits pointer to string in GCC C compiler for arm processor
I tried to declare 16-bits pointers to strings in GNU GCC C compiler for ARM to reduce flash consumption. I have about 200 strings in two language, so reducing the size of pointer i could save 800...
View ArticleWhat versions of C allow you to declare variables in for loops?
Ever since I began coding in C, I was taught thatfor(int i=0;i<10;++i)...worked in C++, but in C you must declare the variable outside of the for loop like so:int i;for(i=0;i<10;++i)...I...
View ArticleXDrawString incorrect encoding
I want to display cyrillic symbols with XDrawString(), but on screen they are shown in wrong encoding.I have installed xfonts-cyrillic in my system (ubuntu 14.04), but still any font from xlsfonts list...
View ArticleDynamic Symbol Table for PE compiled on Linux
I'm trying to get the content of the dynamic symbol table of compiled c file #include<stdio.h>int main(){ printf("Hello, World!"); return 0;}as portable executable (PE) on Linux with...
View ArticleSFINAE with incomplete type template overload doesn't work with Clang while...
I cannot compile the following snippet with Clang, while GCC has no problem:template <typename T, int variant=0>struct FooCallerWrapper;template <typename T>struct FooCallerWrapper<T,...
View ArticleHow to get the error compiler gcc message with shell_exec() using php in...
When I try to compile C file with a correct syntax using shell_exec() function its work fine, but the the problem is when I do a mistake in the C syntax. I can't get the error message from the output...
View Article