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

Using GCC with new glibc and binutils to build software for system with older...

I have a question since some months and I can't come to an answer with Google for a long time.Background: I am cross compiling software for arm based controllers which are running the linux...

View Article


How to include needed C library using gcc?

I am trying to compile the simple C example from this Tutorial on Ubuntu using gcc. What do I have to use as argument for gcc to include the needed libraries for #include...

View Article


clang9(or trunk) vs gcc9: member array size as non-type template parameter...

I have the following mock code#include <array> template<int N> struct S { std::array<int, N> m{}; }; template<int N> auto copy (S<N> const& i) { return...

View Article

"cannot find -lcrypto -lssl" with OpenSSL on Windows with MinGW

Trying out a c code for openssl, and this error showed up while compiling it in the command prompt.c:\openssl>gcc -lssl -lcrypto -o test test.c -IC:\openssl\include\...

View Article

Azure IoT SDK linux sample compile error: In function Send_Sample undefined...

I know there are many questions like this one and I've read many of them but I can't solve my Problem.I'm trying to compile a sample code of the azure iot sdk with gcc on ubuntu.My command line looks...

View Article


How can I use gfortran from a non-standard directory under Linux?

I have installed a relatively new version of gfortran in a non-standard library under Linux. It seems that compiled fortran programs cannot access the gfortran library. Compiling with the -static...

View Article

Image may be NSFW.
Clik here to view.

Stripping out static text from log messages and save only variables [closed]

I know that there is a way to get rid of static text from log messages and keep only the variables part of the message in memory. But I am not sure exactly how it is done.To give a concrete example to...

View Article

Swallowing comma in variadic macros on compilers that do not recognise ##

I need to write a variadic macro in C which must take zero or more arguments.In gcc, that can be achieved by adding "##" after the comma, e.g. ,##____VA_ARGS____ as answered in Variadic macros with...

View Article


Conda GCC compile OpenMP failure

I have a simple openmp example:#include <stdio.h> int main() { #pragma omp parallel { printf("https://helloacm.com\n"); } return 0; } I created two conda environments on different machine using...

View Article


How GCC handles built-in function

I have trouble understanding GCC built-in functions, and feel very confused.What is the difference between a library function and an built-in function? Is there something a built-in function can do but...

View Article

Ninja doesn't use CC and CXX?

I'm compiling Tesseract with Ninja. Clang has some linking problem, and gcc works. I exports CC and CXX to gcc and make -j8 runs fine. However, Ninja (using the given script in /build folder) still...

View Article

Does gcc optimize c++ code algebraically and if so to what extent?

Consider the following piece of code showing some simple arithmetic operations int result = 0; result = c * (a + b) + d * (a + b) + e; To get the result in the expression above the cpu would need to...

View Article

Installing GCC 4.7.1 on OS X

I am trying to install GCC 4.7.1 on my Mac because I want to update the LLVM GCC 4.2 given in XCode.I have downloaded GCC 4.7.1 and I've placed the gcc-4.7.1 folder in ~/Downloads, then I followed the...

View Article


can't complie using gcc with -fopenmp in OS X

I just started learning OpenMP. I tried to compile a simple Hello World C code using gcc. Here's is my command line .gcc -fopenmp HelloWorld.c and this is my simple HelloWorld code ....

View Article

How do the likely/unlikely macros in the Linux kernel work and what is their...

I've been digging through some parts of the Linux kernel, and found calls like this:if (unlikely(fd < 0)) { /* Do something */ } orif (likely(!err)) { /* Do something */ } I've found the definition...

View Article


What is the advantage of GCC's __builtin_expect in if else statements?

I came across a #define in which they use __builtin_expect.The documentation says:Built-in Function: long __builtin_expect (long exp, long c)You may use __builtin_expect to provide the compiler with...

View Article

OMP reduction with Eigen array runs in GCC but not in Clang

I am using OpenMP to parallelize a loop summing Eigen arrays. Compiling the code with GCC and Clang works, but Clang gives me a SIGSEGV with the error:double free or corruption (!prev) Segmentation...

View Article


Is there a compiler hint for GCC to force branch prediction to always go a...

For the Intel architectures, is there a way to instruct the GCC compiler to generate code that always forces branch prediction a particular way in my code? Does the Intel hardware even support this?...

View Article

Failing comparison of floats NaNs on STM32F407 CORTEX-M4 [duplicate]

I'm trying to compare two floats returned from nanf("1") and the program is not entering if block.int main(void) { volatile float f; volatile float ff; uint32_t* view1; uint32_t* view2; view1 =...

View Article

inline assembly in C++ function with return statement

Consider this code:#include <cstdio> int get_value() { asm("movl $254, %eax"); } int main() { printf("%d\n", get_value()); } Now if one compiles this code with g++ main.cpp, one gets a compiler...

View Article
Browsing all 22230 articles
Browse latest View live


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