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

Error building program using gcc plugin from linux kernel source tree

I am trying to use a grsecurity gcc plugin that I found on their unofficial linux kernel source tree (the respectre_plugin/ one).My GCC version is 4.7, I modified scripts/gcc-plugins/Makefile to make...

View Article


non trivial loop unrolling

I have the following non trivial loop that does 10 iterations and stops (computes n over k)#include <stdio.h>#include <stdlib.h>int main(int argc,char **argv){ int d=1; bool f = true;...

View Article


Qt 5.1.1 compiler setup on Ubuntu

First of all, I should point out that I've never used linux before.I have a clean install of 64bit ubuntu, I downloaded Qt 5.1.1 for linux 64 bit from http://qt-project.org/downloads, ran the .run...

View Article

Saving XMM registers to variables

Is there a C function call (I'm using gcc) that will save an XMM register to a specified __m128 variable? I'd like to avoid direct assembly if possible.The use case here is I'm writing an exception...

View Article

How do I ignore a particular gcc warning that's [enabled by default]?

I have the following program that prints green text to the terminal:#include <iostream>#include <string>//returns a colored string for terminal output streamsstd::string...

View Article


dlib hangs when building on Google Coral dev board

I am struggling with installing latest version of dlib (http://dlib.net/, v19.17) for Python on the Google Coral Dev Board. It works well with Raspberry Pi 3 B+ (that seems to have exactly the same CPU...

View Article

Do I need to compile the header files in a C program?

Sometimes I see someone compile a C program like this:gcc -o hello hello.c hello.hAs I know, we just need to put the header files into the C program like:#include "somefile"and compile the C program:...

View Article

Why does the following code compile using clang but not gcc

#include <iostream>#include <unordered_map>#include <string>struct tree_node { // tree_node() : attrib_val{"null"} {} std::unordered_map<std::string, tree_node> child;};int...

View Article


How can I configure Codeblocks to not close the console after the program has...

I should specify, I do not want to do the waiting for input thing or to use the debugger. I want the program to run and terminate as it normally would, but where the console window doesn't close after...

View Article


Is there any way to extract asserts from C files?

Is there a simple way to extract the inside of the assert functions from C files?For example - assert(cred->keytab == NULL);/*assert(1==1);*/The output should be -cred->keytab == NULLI'm looking...

View Article

Image may be NSFW.
Clik here to view.

My c++ program is compiling fine, but not running . My program is running and...

My c++ program is compiling with no error. I am running my program on vscode . In the same file, when i run this code.My system:Windows 10visual studio code c++ 14#include<bits/stdc++.h>using...

View Article

What is the difference between __i686.get_pc_thunk and __x86.get_pc_thunk?

These helper functions are used by GCC and Clang in 32-bit x86 position-independent code to get the current execution address into a register, for example:call __i686.get_pc_thunk.bxaddl...

View Article

Link-time optimization and inline

In my experience, there's lot of code that explicitly uses inline functions, which comes at a tradeoff:The code becomes less succinct and somewhat less maintainable.Sometimes, inlining can greatly...

View Article


I believe GCC is producing incorrect machine code

I am trying to compile this dead simple program:int print(int x, int y){ return x * y;}int main(){ return print(8, 7);}with this command: gcc -c -nostdinc -m32 -masm=intel main.c -O0The file produced...

View Article

Using of overloaded new/delete and STL in shared library

I've faced with problem which was caused by conjunction of overloaded operators new/delete and STL (especially std::string). Here's my case...I compile shared library (call it libfoo.so), in which I...

View Article


Best Way to Make Visuals in C? [closed]

I'm trying to make a pie chart or some kind of visualization of two parts of a whole. I'm using a gcc compiler. gnuplot is a pain. Any recommendations?

View Article

Is it a gcc -O2 optimization bug (different result from -O1)?

I write a very simple program, it behaves normal without -O2:#include <stdio.h>#include <stdint.h>int main(){ uint32_t A[4] = { 1, 2, 3, 4 }; float B[4] = { 0, 0, 0, 0 }; float C[4] = { 5,...

View Article


Failed to compile netperf 2.7.0 using Cygwin

Not sure if this is the right place to ask this but I am having issue getting netperf 2.7.0 using Cygwin. Based on what I read, many people have success getting netperf to compile using Cygwin so I am...

View Article

How to bind Python to C++ code that includes Jsoncpp?

Working on a code that enables Python to call a C++ code compiled into shared library file (.so file) via Python's ctypes module, using the standard ctypes.CDLL method. The C++ code performs the...

View Article

Why do compilers insist on using a callee-saved register here?

Consider this C code:void foo(void);long bar(long x) { foo(); return x;}When I compile it on GCC 9.3 with either -O3 or -Os, I get this:bar: push r12 mov r12, rdi call foo mov rax, r12 pop r12 retThe...

View Article
Browsing all 22042 articles
Browse latest View live


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