Category "gcc"

Why is calling snprintf() so slow?

Our internal program is written in C and makes extensive use of snprintf() for many pieces, and I noticed that during debugging with perf record/report, it's sp

Compile and run assembly on macbook

I'm taking a course on computer structure and I'm lost. I was given the following file: Hello.s: #This is a simple "Hello World!" program .section .rodat

How to covert the address from KCOV output to filename:lineno using addr2line?

I want to use KCOV (code coverage for fuzzing) in the Linux kernel to record the coverage of certain system calls. I have enabled the corresponding kernel conf

Looking to use a library with example code for Open Quantum Safe

So I am trying to use following library: Open Quantum Safe I am using windows linux subsystem, so I followed the linux setup. I think I followed all the steps c

DCDO and FRAME PUSH instruction in Gnu GCC assembler syntax

I am importing arm asm assembly code to GNU assembler and not able to find the instruction for DCDO and FRAME PUSH that are used in keil(arm asm).

object file not PIC showing relocatable?

I have a small library, and I build it with gcc without -fPIC option, I think this would mean that the generated object file will not be relocatable, but when I

Why is the XOR swap optimized into a normal swap using the MOV instruction?

While testing things around Compiler Explorer, I tried out the following overflow-free function for calculating the average of 2 unsigned 32-bit integers: uint3

g++: error: unrecognized '-std=c++17' (what is g++ version and how to install)

I am working on RHEL 7.5 and trying to compile a uWebSocket (This exaple) code. I clone the project and open it. When I start make on Makefile I got this error;

"g++: error: unrecognized command line option ‘-std=gnu++14’" with gcc version 9.3.0

I have the CentOS Linux release 7.9.2009 (Core) running in the VirtualBox, which was build by the Vagrant 2.2.19 and the Ansible 2.9.25 installed all the depede

OpenVAS libgvm_util.so: undefined reference to `MQTTClient_`

Have some troubles in compiling from source https://github.com/greenbone/openvas.git cmake was done successfully, but make failed with: /usr/bin/ld: /opt/gvm/li

Why does GCC include an "empty" XOR

I have following piece of code: typedef struct { int x; int y; int z; int w; } s32x4; s32x4 f() { s32x4 v; v.x

Go 1.13: gcc-5 not in PATH

I've installed Go 1.13.4 in Debian Linux 10 using brew, package golang (previously I've removed golang-1.11 installed via apt). It follows brew info output. $

What are the examples of non-ISO practices, which are not found by -pedantic?

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html : Some users try to use -Wpedantic to check programs for strict ISO C conformance. They soon find that

how to find the dependencies of a source code?

Let say I have a simple c-library project, the layout is as follows - src/ - square_root.c - log.c - power.c - newton_method.c - include

Why can't local variable be used in GNU C basic inline asm statements?

Why cannot I use local variables from main to be used in basic asm inline? It is only allowed in extended asm, but why so? (I know local variables are on the st

Using operator ""s for std::chrono with gcc

I want to use the std::chrono::duration literals, such as 10s to mean "10 seconds", like this: std::chrono::duration<uint64_t, std::milli> millisecs = 10s

Can anyone explain how to use OpenACC in GCC?

I am using WSL Ubuntu. And use GCC to compile my C++ code. I am trying to use OpenACC to parallelize my code. I heard that I can use OpenACC with GCC. So after

Eclipse can't find linked libraries

I am working with the windows.h functions and everything works fine so far. But when I try to use functions which require me to link external libraries somethin

VisualStudio2022 can't navigate from compile error to source

I'm using VisualStudio 2022 community to develop linux program. The cross-platform compile do works and compile outputs shows Output view well. But when double

Cygwin: C standard library does not support TIME_UTC and timespec_get?

Sample code (t667c.c, taken from here): #include <stdio.h> #include <time.h> int main(void) { struct timespec ts; timespec_get(&ts, TIM