Quantcast
Browsing all 22037 articles
Browse latest View live

Calling a static function from global inline assembly

I'm trying to define a function without any prologues/epilogues, a "landing address" so it can call an inner function which is properly managed by the compiler (useful for a caller-cleanup...

View Article


GCC seems to prefer small immediate values in comparisons. Is there a way to...

Firstly a trivial mathematical fact: given integers n and m, we have n < m if, and only if, n <= m - 1.GCC seems to prefer immediate values of smaller absolute value. Hence, when m is known and...

View Article


Failed to Build Boost With devtoolsets-8-gcc?

I tried to build Boost 1.71.0:sudo ./bootstrap.sh --prefix=/opt/boost -with-toolset=gcc And it gave:Building Boost.Build engine with toolset gcc... Failed to build Boost.Build build engine Consult...

View Article

Does GCC have builtins for AVX512 operations?

I was expecting to find functions like__builtin_ia32_fmaddps512in a recent GCC to enable use of 512 bit AVX512 registers in the same way that one can use the 256 bit AVX2 registers, but they do not...

View Article

gcc c++ stl pretty printer - invoke manually and ask for size only

How can i in gdb invoke StdDequePrinter manually for a gdb.parse_and_eval()'ed variable? And why doesn't StdDequePrinter and alike have function to query the size of the container only?

View Article


How do I create a single makefile for both 32- and 64-bit?

I have a makefile that works transparently for Linux (x86_64) and OS X Intel (x86_64). This uses 64-bit specific GCC options.Is there a way to adjust the makefile so that I could build for 32-bit and...

View Article

Linking libwiringPi on Cross Compiler for RPI

I have a RPI 3 model B, and I want to compile a small program for interacting with the device's SPI. I am writing the program on my Linux desktop so I want to cross compile the program. For this I have...

View Article

Does GMP work with gfortran? Is there an arbitrary precision arithmetic...

I'm working on some Fortran things, probably Fortran90 or Fortran95, and was wondering if GMP works with gfortran compiler. If so, how would one use the arbitrary precision arithmetic in gfortran?...

View Article


Programmatically cause Undefined Instruction exception

I want to cause an ARM Cortex-M3 Undefined Instruction exception for the test of my test fixture. The IAR compiler supports this with inline assembly like this:asm("udf.w #0");Unfortunately the GNU CC...

View Article


Why does GCC aggregate initialization of an array fill the whole thing with...

Why does gcc fill the whole array with zeros instead of only the remaining 96 integers? The non-zero initializers are all at the start of the array.void *sink; void bar() { int a[100]{1,2,3,4}; sink =...

View Article

Is an optimized out variable allowed to hold a value out of its range?

Is the compiler allowed to store a larger value in an 8-bit uninitialized variable?I have an example code to illustrate the issue.#include <stdio.h> #include <inttypes.h> int unhex(char...

View Article

understanding WARN_ON_ONCE macro definition

I was going through the WARN_ON_ONCE macro definition. I have doubt regarding the following line, what is the use of !! before condition. If we remove !! then also same will be stored in...

View Article

Is this a C language undefined behaviour? Different results in clang and GCC

I'm getting different results for the same code with different compilers. Is this a undefined behaivour?#include <stdio.h> int a; int b=10; int puan_ekle(int puan, int bonus){ puan=puan+bonus;...

View Article


Any tips for compiling huge code generated source files?

I am trying to compile generate C code which comes from large Dymola models. The code generated is unlike what a human would write, there are many unrolled loops, extensive use of macros, huge arrays...

View Article

Difference Between GCC (G++) compiler and visual c++ compiler when using...

This question already has an answer here:Why does omission of “#include <string>” only sometimes cause compilation failures? 6 answersI was playing around with some code for reading lines from...

View Article


How to use pkg-config in Make

I want to compile the simplest GTK program. I can compile it using the command line:gcc $(pkg-config --cflags --libs gtk+-3.0) main.c -o main.o However, if I use Make it doesnt work:CFLAGS=-g -Wall...

View Article

gcc: undefined reference to

I would like to compile this.program.c#include <libavcodec/avcodec.h> int main(){ int i = avpicture_get_size(AV_PIX_FMT_RGB24,300,300); } Running this gcc -I$HOME/ffmpeg/include program.c gives...

View Article


Why the same CFLAGS can be repeated twice in a makefile?

this is the secation of makefile:CFLAGS += -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 CFLAGS = -g -O2 -Wall CFLAGS += -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 The first line...

View Article

dlib hangs when building on Google Coral dev board

I am struggling with installing latest version of dlib (http://dlib.net/, v19.17) for Python on the Google Coral Dev Board. It works well with Raspberry Pi 3 B+ (that seems to have exactly the same CPU...

View Article

(.text+0x20): undefined reference to `main' and undefined reference to function

I am having issue getting my makefile to work without errors. The first issue i have is with an undefined reference to main. I have main in my producer.c file as a function. The second issue is an...

View Article
Browsing all 22037 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>