Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 22042 articles
Browse latest View live
↧

How can I create a function call in GIMPLE representation?

I'am trying to create a function call in Gimple.Since the documentation on this is so poor, I can't see how to proceed.In particular I would like to know how to build this function:uint32_t *m_addr =...

View Article


Advanced C and C++ compiling: unable to compile the example program mentioned...

I'm reading the book named "Advanced C and C++ compiling", by Milan StevanovicThe following is the snapshot from the book, followed by the problem I'm facing.Concept illustration: Demo ProjectThe...

View Article


Why does gcc -O3 handle avx256 compare intrinsic differently than gcc -O0 and...

I want to set two integer vectors and compare them with SIMD, and later on use this mask for a blend operation on packed floats. I produced the following code:#include <immintrin.h>#include...

View Article

How to get rid of Eclipse indexer "Type std::... could not be resolved"...

Steps to reproduce.Use Linux system where g++ defaults to standard older than c++17, but supports c++17 if given -std optionCreate trivial C++ project outside of Eclipse with main.cpp:#include...

View Article

Son of GCC conversion warning when assigning to a bitfield

I am trying to solve almost the exact same problem as GCC conversion warning when assigning to a bitfield except none of the solutions appear to work. As with the linked problem, gcc version does not...

View Article


How to make lcov perform faster?

I'm having performance issues with lcov.I'm executing a program in seven different profiles, collecting the coverage for each of them and then merging the coverage profile with lcov: lcov --rc...

View Article

Visual Studio 2017 CMake linking error (undefined reference to)

I'm working on a cross platform c++ application (windows & Linux). I'm using VS 2017 professional as my IDE and Cmake as my build tool. Code contains both c & c++ files. Currently I'm able to...

View Article

Image may be NSFW.
Clik here to view.

How to override the entrypoint like __libc_start_main with g++

We want to inject some functions before user's main function and found LD_PRELOAD to override __libc_start_main would work for C programes with gcc.However, it doesn't work with cpp file which may use...

View Article


Compiling multiple C files with gcc

I have two files, main.o and modules.o, and I'm trying to compile them so that main.o can call functions in modules.o. I was explicitly told not to try #include module.o. I really don't know what I...

View Article


Why does using initialisation list in class constructor generated a...

I was working on a personal project with classes and didn't wanted to initialling each of the data members. So I made a call to *((Classname *)(this)) = {}; in the constructor. Hoping that it would...

View Article

Set the default GCC to Xcode Command Line Tools

How can I ensure that gcc points to a particular compiler? Can I make a permanent symbolic link to the xcode version of gcc?I have several versions of the gcc compiler installed on my system, including...

View Article

binary hardening with -fstack-protector-all not reflecting

I applied the flag -fstack-protector-all while compiling a binary but it not reflecting in the final executable. I checked it with this script. It shows No canary found. My code has the static char...

View Article

Is there a way to force gcc to start a new stack frame for a block?

In embedded C++ code where RAM and hence stack space is limited, I often come across this situation:void f(parameters) { if (condition) g(...); // g uses lots of stack space else { int table[1000]; //...

View Article


C nested function and promises

For a project I am working on I would like to use GCC nested functions because I would like to have a sort of lambda:I am not interested in supporting other compilersI don't want to access variables...

View Article

ld:library not found gcc for -lcrt0.o

I am new on using mac os I tried to compile my c code after installing gcc using brew tool and then when I run on terminal :gcc -static -O3 javaLauncher.c -o javaLauncher I got that error ld :library...

View Article


gcc compilation with dark moon cygwin

I am learning to use bash on Windows, I installed dark moon cygwin and I want to compile "old code" with gcc on windows. I can compile my code and run it in dark moon, but when I put it on another...

View Article

In C++ can we dereference this pointer? If so then how and if not then why?

I was working on a personal project with classes and didn't wanted to initialling each of the data members. So I made a call to *((Classname *)(this)) = {}; in the constructor. Hoping that it would...

View Article


Is passing around a GCC nested function valid? If not, are what alternatives...

For a project I am working on I would like to use GCC nested functions because I would like to have a sort of lambda:I am not interested in supporting other compilersI don't want to access variables...

View Article

C++ program compiled without problems but doesn't run

There is my code. It does compile without any errors, but it doesn't output anything. When I open program.exe it instantly is closed even if I add "cin.get()" at the end of program. When used in...

View Article

Image may be NSFW.
Clik here to view.

Redundant register values in GCC-compiled binary? [duplicate]

Alright, so I'm trying to learn reverse engineering and x64 assembly. As an example I wrote this little test program in C:#include <stdio.h>int square(int num) { return num * num;}int main() {...

View Article
Browsing all 22042 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>