Issue using NULL in C files on Vim w/ Syntastic
Heyo!I have been using the Syntastic syntax checker plugin for a little while and have been really enjoying the experience except one irritating bug I cannot seem to figure out how to eliminate. Every...
View Articledisable all warnings for google tests from cmake
I have a c++ project that I am compiling with cmake. I am also using google tests. These are my cmake files:cmake_minimum_required(VERSION 3.5)project(se-03-team-08 LANGUAGES CXX)set(CMAKE_CXX_STANDARD...
View ArticleWhy gcc 4.1 + gcov reports 100% branch coverage and newer (4.4, 4.6, 4.8)...
When gcc 4.1 (using gcov) next line:p = new Class;is reported as 100% branch coverage <-- THIS IS OK for me.Why using gcc 4.4 and higher same line is reportted as:[+ -] p = new Class; (50% branch...
View ArticleProgram jumping to the end of function
Can anyone tell me why this function is not being executed properly? It is jumping straight to the end and printing the last line:"0 pages faults"when there should definitely be some activity. I'm not...
View ArticleCan't install texinfo package on Ubuntu 18.10
I'm attempting to install the GNU texinfo onto my machine but when I do sudo apt install texinfo I get the following: Ign:1 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 tex-common all 6.10...
View ArticleCan't compile and run C program on linux
I'm trying to compile a program in Ubuntu using gcc (I'm using Ubuntu for windows).I've tried using -no-pie, -Wall, but to no avail.I need the executable to be 32-bit, I'm using a 64-bit system but I...
View ArticleMake - Internal compiler Error under QT 5.14.2 "Q_CORE_EXPORT"
I just installed QT Creator with QT under Win10 to build an already existing project. (Under Ubuntu everything went fine running the Make file). I'm not an expert for QT therefore I'm not able to find...
View ArticleMemory alignment allocates wrong size of memory [closed]
I have following structure:struct Vertex { int y; int price; int x; struct Vertex* prev; char type;};When I print sizeof(structure(Vertex)) I get 32 bytes which is okay. Although, when I change the...
View ArticleHow to force compiler to generate ADOX/ADCX instead of ADC in x86_64?...
Intel introduced ADCX, AODX to support big integer arithmetic but it is hard to generate ADCX/AODX using only one function: _addcarryx_u64Suppose that for big integer addition of A and B where the...
View Articlesetup script exited with error: command 'x86_64-linux-gnu-gcc' failed with...
When I try to install odoo-server, I got the following error: error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1Could anyone help me to solve this issue?
View ArticleUndefined references to libm symbols after upgrading Linux distro
I upgraded my Linux distro from Pop OS 19.10 to 20.04, and it naturally included upgrades to glibc & co. Since then, I started getting linker errors for libm symbols like...
View ArticleIs it possible to get Lexer output from gcc or clang?
Is it possible to get clang or gcc to display the result of the lexing phase?
View ArticleCMake cannot indentify path to compiler mentioned by set(CMAKE_C_COMPILER...
OS: Windows 10 compiler: g++ 9.2.0 call:cmake .my CmakeLists.txt:cmake_minimum_required(VERSION 3.17.1)project("Client")set(CMAKE_C_COMPILER "C:/Strawberry/c/bin/gcc.exe")set(CMAKE_CXX_COMPILER...
View ArticleWhy is this code 6.5x slower with optimizations enabled?
I wanted to benchmark glibc's strlen function for some reason and found out it apparently performs much slower with optimizations enabled in GCC and I have no idea why.Here's my code:#include...
View ArticlePrinting array of ints generates weird output in ada
I created a simple ada program that allows a user to populate an array with a maximum of 100 non negative and non zero integers and then prints them out. When I call the function to print out the...
View ArticleHow to change makefile generator for CMake?
Asked this question:CMake cannot indentify path to compiler mentioned by set(CMAKE_C_COMPILER "path") rulereceived an incorrect rules order response(it was obviously correct).Aplied changes and tried...
View ArticleUnderstanding the assembly language for if-else in following code [duplicate]
Following is the c++ code;int func1(int i) {return i*7;}int func2(int i) {return i*11;}int test(int i){ int j; if(i>0) { j = func1(i); }else { j = func2(i); } return j*13;}The instructions for above...
View Articlewhy gcc in Centos gives different result of this c program
I use Codeblocks on my computer and also checked it with dev++ and both give the same correct results when I give test.txt as input file and stop.txt.https://pastebin.com/Z8CPnJNd (test.txt) and...
View ArticleShould a switch statement always contain a default if it initializes local...
Here's a piece of code from the FastNoise library of Jordan Peck. It gives a whole lot of compiler warnings, among which is this particular switch statement. Here you can see that variables xs, ys and...
View ArticleHow to install gcc-9 on debian:latest docker
In order to use the C++17 include <filesystem> I need gcc-9 package in my debian docker.By default debian:latest (aka 10 or buster) will install gcc 8.3.0 from the regular distro repo.Is there...
View Article