Why would you use the ternary operator without assigning a value for the...
In the Android open-source qemu code I ran across this line of code:machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */ Is this just a confusing way of saying:if...
View ArticleOpenMP 4.0 in GCC: offload to nVidia GPU
TL;DR - Does GCC (trunk) already support OpenMP 4.0 offloading to nVidia GPU?If so, what am I doing wrong? (description below).I'm running Ubuntu 14.04.2 LTS.I have checked out the most recent GCC...
View ArticleHow to dump RTL files after linking multiple source files in GCC (linux)?
I am using egypt for making call graphs of my C project (a linux driver module). My problem is that function calls from one file to another file aren't shown. Most probably, this is because RTL files...
View ArticleHow to disable ARM coprocessor instructions with gcc?
Is there a way with a recent gcc to disable the use of coprocessor instructions: CDP, LDC, STC, MCR and MRC ?They seem to be grouped in an autoconf variable named arm_coproc1_ok.I tried to set the...
View ArticleHow to install Pygame on MacOS Mojave?
I'm trying to install Pygame, but this doesn't work.. I'm on Mac, using MacOs Mojave, and SublimeText. I tried python3.8 -m pip install Pygame and python3 -m pip install -U pygame in the terminal,...
View Article"No such file or directory" error when active file ${file} is in subdirectory
Using VS Code and my tasks.json reads...."label": "echo", "type": "shell","command": "gcc","args":["-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe"], "group": {"kind":...
View Articledifference between and
When I use malloc in a C program, I get a warning:warning: incompatible implicit declaration of built-in function 'malloc' [enabled by default] I can then include <malloc.h> or <stdlib.h>...
View ArticleHow to write a plugin to implement the function of adding a new assembly...
I want to add an assembly instruction to GCC that detects array boundarie.The form of instruction is "check rd,rs1,rs2". Now, I am writing GCC plugin, I have obtained the information of the array in...
View ArticleARM GCC C++14 POD types are not put in the ROM
I have been experimenting with the binaries generated with the ARM GCC compiler (Version 9.2.1). I noticed that even if I compiled the program with C++14 support, the lenient rules for POD types in are...
View ArticleUndefined Reference to imp using mingw
The problem I have is the "undefined reference to '_imp__...'" error that comes up when I build my project. I am using Windows 7, MinGW, Eclipse and .lib and .dll file that I did not make, but I took...
View ArticleGet "Access is denied" when trying to compile with g++ from command line. Cygwin
I have installed all packages in cygwin. I have also added C:\cygwin\bin to my PATH variable. But when I try to compile a c++ file in command line I get the error 'Access is denied'. The same commands...
View ArticleWhy is stoi overloaded when using a string? [closed]
I am converting an old C program into modern C, due to the fact that certain errors occur that did not occur in previous versions of gcc. Here is an example of code that occurs quite frequently in...
View ArticleDoes compiling with -g, in itself, degrade performance? [duplicate]
(This is a question about gcc and clang, but might apply to other compilers.)If I compile my C or C++ code, and generate debug info using the -g switch, does this in itself degrade performance of the...
View ArticleInstall older gcc/g++ versions in CentOS 8
I've been struggling with this for the past 2h. In CentOS 8 I can't find the devtoolset packages to install older gcc/g++ versions. There is no longer a scl repo for CentOS 8. I need gcc/g++ 4.9x...
View ArticleEarly-clobbers and named registers
I'm trying to understand the usage of "early-clobber outputs" but I stumbled upon a snipped which confuses me. Consider the following multiply-modulo function:static inline uint64_t mulmod64(uint64_t...
View ArticleHow to install *.deb file without dpkg package?
I'm using iMX6S-wandboard. Currently, my distro isn't install dpkg package. So I can't install any file *.deb normally. But I don't know exactly what I need to complete. This is a way and it's not...
View ArticleHow to cross compile GStreamer Application for ARM?
I make an GStreamer application on my laptop for my ARM board. And I don't know how to cross-compile. I tried to build gcc many times on my ARM board but not working.So, what I can do now ?Thank you,Toan
View ArticleWhat does __VA_ARGS__ in a macro mean?
/* Debugging */ #ifdef DEBUG_THRU_UART0 # define DEBUG(...) printString (__VA_ARGS__) #else void dummyFunc(void); # define DEBUG(...) dummyFunc() #endif I've seen this notation in different headers of...
View ArticleExecutable without dynamic linkker
Can I compile (using g++ compiler) an executable (on linux) and strip out the dynamic linker /lib64/ld-linux-x86-64.so.2 ? I mean that if I ldd the executable after building it should detect the linker...
View ArticleHow do you get assembler output from C/C++ source in gcc?
How does one do this?If I want to analyze how something is getting compiled, how would I get the emitted assembly code?
View Article