Can gcc on Ubuntu on a 64-bit machine generate an executable where long is...
In other words is compilation with data-model LLP64 possible in this environment? Please note that my pointers should be 64-bit.
View ArticleWhat does -Wall flag do when I compile it with the program?
I am following a tutorial that says how to profile the program using gprof and the command given is like thisgcc -Wall -pg test_gprof.c test_gprof_new.c -o test_gprofBut it doesn'y give any explanation...
View ArticleMake compilers not compile indirect calls
I have the following hashmap:typedef uint32_t (*HashFuncPointer)(uint32_t key);typedef bool (*KeyComparisonFunc)(uint32_t key1, uint32_t key2);typedef struct Hashmap { void* items; uint64_t max_size;...
View Articlestack unwinding using unwind.h
I want to do stack unwinding using gcc. I can not find an example code that shows me how to do this.I tried to follow the instructions from this site, but i realised that the unwind.h that my gcc is...
View ArticlePHP override_function without the use of APD?
I'm trying to use override_function http://php.net/manual/en/function.override-function.phpfrom http://pecl.php.net/package/apdbut APD hasn't been updated since 2004 and no longer installs via PECL.I...
View ArticleWhat is the order of evaluation in a member initializer list?
I have a constructor that takes some arguments. I had assumed that they were initialized in the order listed, but in one case, it appears they were being initialized in reverse, resulting in an abort....
View ArticleWhat's the difference between puts() and printf() in C compiled into Assembly?
This is my C program using puts():#include <stdio.h>int main(void){ puts("testing");}After using gcc -S -o sample.s sample.c in order to compile it into Assembly, this is what I got: .file...
View ArticleVS Code terminal doesn't run a C++ program when building with Ctrl + Shift + B
I'm using Visual Studio Code for C++ coding and I'm using g++.exe for compiling with MinGW for building.It builds and runs my C++ code properly when I do not use Ctrl + Shift + B. (F1 -> C/C++ :...
View ArticleHow to get fullstacktrace using _Unwind_Backtrace on SIGSEGV
I handle SIGSEGV by code:int C(){ int *i = NULL; *i = 10; // Crash there}int B(){ return C();}int A(){ return B();}int main(void){ struct sigaction handler; memset(&handler,0,sizeof(handler));...
View ArticleHow to generate non-temporal instructions?
Intel's compiler has a pragma that can be used to generate non-temporal stores. For example, I can writevoid square(const double* x, double* y, int n) {#pragma vector nontemporal for (int i=0; i<n;...
View ArticleAdobe alchemy compiler problem- it generates .l.bc files, how to turn them...
So I try to compile ffmpeg as I described here after this patch I started seeing .l.bc files but no .swc files. So how to use alchemy completion suite to turn .l.bc into .swc?
View ArticleIs it possible to set CFLAGS to a linux kernel module Makefile?
Eg: a common device module's Makefileobj-m:=jc.odefault: $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modulesclean: $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd)...
View Articleclangd code completion in vscode gives incorrect tips when developing Qt...
I use VSCodium and gcc complier to develop c++ in linux, clangd server and clangd vscode plugin have been installed. My example code is shown below.QByteArray...
View ArticleC++ converting constructor behavior changed in gcc 12?
I am observing a weird behavior, which I cannot explain.The following code (a simplified version of the actual code) compiles correctly in gcc 11.4, and the argument "val" inside the read() method of...
View Articleerror executing command line of -M32 in Linux Gcc- M3 ARM processor [closed]
@ubuntu-linux-2404:~/Downloads$ less Makefile@ubuntu-linux-2404:~/Downloads$ makegcc -Wall -Wextra -g -fno-stack-protector -m32 -z execstack -fno-stack-protector -m32 -z execstack ex1.c -o ex1gcc:...
View ArticleHow to fix this? c++ compiler set up
I installed gcc via xcode but I am getting this error when trying to compile the file: sanjay$ g++ main.cppUndefined symbols for architecture x86_64:"Fraction::Fraction(int, int)", referenced from:...
View Articleundefined reference to ruserok error
I've run into a strange "undefined reference to" compile error that I cannot seem to find a resolution for. I'm trying to configure/compile PAM 1.1.6 for my Gumstix Overo using the Yocto Project...
View ArticleInstall i386-elf-gcc on Mac OS 15
I'm trying to install i386-elf-gcc per the directions in this readme part of the OSTEP course.I tried installing using sudo port install i386-elf-gcc gdb but running into Error: Processing of port...
View Articlegcc compiled code on visual studio
Assume I have source code for a lib/tool that works on gcc compiler. Can I use the same code and compile it in visual studio. will that be possible at all? If it is possible, how do I do it?
View ArticleWhy is a function that only returns a stateful lambda compiled down to any...
The following non-templated (or is it?) function returning a non-generic, stateful lambda,auto foo(double a) { return [a](double b) -> double { return a + b; };}compiled down to this with GCC or...
View Article