gcc loop construct changes to assembly code [duplicate]
This question already has an answer here:Why are loops always compiled into ādoā¦whileā style (tail jump)? 1 answerWhy does the gcc compiler translate while loops into do-while constructs when creating...
View ArticleCan't compile a C program on a Mac after upgrading to Catalina 10.15
There's a previous question Can't compile C program on a Mac after upgrade to Mojave, and the answers to that have covered most of the variations on what goes wrong.Now ā as of Monday 2019-10-07 ā you...
View ArticleC++ Boost undefined reference to `boost::filesystem::path::m_normalize()'
I am trying to compile a program called UKB (https://github.com/asoroa/ukb), but I am facing problems in compilation that I cannot solve:When I execute make it returns g++ -c -O2 -Wall -Wno-deprecated...
View Articleglib.h negative array size error in 64 bit but not 32 bit build
I am working in a dev environment where we produce both 32 and 64 bit executables. I have one application that is failing to build in 64 bit mode. It uses inotify and includes glib.h to get the...
View ArticleHow can I remove the need of wpcap.dll in my go program?
I use gopacket in my program. on linux, it runs perfectly. But on windows the whole program crashes if i did not install WinPcap before.My plan was to check if WinPcap is installed, and if not to...
View Articlef2py linking quadmath libraries?
I have spent the last three days trying to use f2py to interface fortran to python. I am working on windows using both cygwin and mingw. This post is about using cygwin, but I'm concerned about...
View ArticleGCC constexpr allows add but not bitwise-or with address
Consider this code:#include <cstdint> static int x = 0; const uintptr_t arithmetic() { static constexpr uintptr_t result = ((uintptr_t)&x) + 1u; return result; } const uintptr_t bitwise() {...
View Articlegcc -masm=intel gives me lowercase mnemonics
Compiling a simple C program with with gcc -masm=intel basic.c -o basic.asm generated assembly like below :.cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp /I expected mov...
View ArticleWhy does this simple assembly program work in AT&T syntax but not Intel syntax?
What's wrong with this code (Running on x86_64 Linux)?.intel_syntax .text .globl _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, 14 syscall mov rax, 60 mov rdi, 0 syscall .data msg: .ascii...
View ArticleWill compiler create vtable irrespective of object creation in c++
class B { public: virtual void fun1() {} }; class D: public B { public: virtual void fun1() {} }; int main() { //Empty Main. //Not creating any object of B or D. return 0; } In GCC or Visual Studio,...
View ArticleDifference in gcc -ffp-contract options
I have a question regarding the -ffp-contract flag in GNU GCC (see https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html).The flag documentation is written as follows:-ffp-contract=off disables...
View ArticleBuild Tensorflow on Intel Atom
I am trying to build Tensorflow on Intel Atom using Bazel 0.15 version.I followed the instruction here for Build TensorFlow from Source with IntelĀ® MKL.My bazel command for Intel Atom isbazel build...
View Articlechecking if a binary compiled with "-static"
I have a binary file in linux. How can I check whether it has been compiled with "-static" or not?
View ArticleOne or two weird linking errors with some inline assembly
I have the following short application (The original is taken from: https://www.aldeid.com/wiki/X86-assembly/Instructions/str) I just modified it (tried to...) to make it compilable on linux...
View ArticleEclipse Artifact name variable while build steps
In eclipse I can use in C/Cpp Build->Setting ->Build artifact->Artifact name to configure the name of the binary that export in build.When I want to use this Artifact name as a variable in...
View ArticleCMake library linking order
I have following libraries lib_A, lib_B, lib_C, lib_D. I am doing something like this in my CMake files (order is...
View ArticleCMPLX Yields Undefined Symbol with GCC
I'm trying to hunt down a problem using complex literals when compiling with GCC. Consider the following#include <stdio.h> #include <complex.h> int main(void) { double complex z =...
View ArticleWhat does this GCC error "... relocation truncated to fit..." mean?
I am programming the host side of a host-accelerator system. The host runs on the PC under Ubuntu Linux and communicates with the embedded hardware via a USB connection. The communication is performed...
View Articlewhere can I find the reference of gcc extended attribute
In Linux kernel, compiler.h, I found definition of __iomem# define __iomem __attribute__((noderef, address_space(2)))Then I knew that __attribute__(()) is an extension of GCC. But I can't find...
View ArticleMac OS: Catalina: unable to execute 'gcc': No such file or directory
MAC OS Catalina(10.15.1) seems to have created some problems for building code that uses gcc. I am trying to build a python application which is running into the following error.Running setup.py...
View Article