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

After installing Mingw-w64, PATH of Python version is changed

I installed Python 3.7 before, but after installing Mingw-w64, I found the PATH is changed.When I input "python" in the shell, it tells me that Python 2.7.9 (default, May 12 2018, 10:00:46)[GCC 8.1.0]...

View Article


Why does issuing empty asm commands swap variables?

So I was messing around with inline assembly and compiled this using GCC 9. The result was that the two variables a and b were swapped without actually issuing any direct...

View Article


gcc not compiling with openssl includes

I'm having some trouble trying to compile some code that includes openssl using the following gcc commandgcc -Wall -O2 -std=c89 -pedantic -static...

View Article

Undefined reference to openssl functions when compiling with gcc in Ubuntu 11.10

In Ubuntu 11.10 x86_64 I have this this simple test.c file:#include <openssl/ssl.h> int main() { SSL_library_init(); return 0; } Why does compiling with gcc fail?$ gcc -lssl -lcrypto test.c...

View Article

Why does GCC set eax to 0 before call instructions? [duplicate]

This question already has an answer here:Why is %eax zeroed before a call to printf? 3 answersGiven the following C code:#include <stdio.h> int main() { printf("%d\n", 1); return 42; } compiled...

View Article


Configution "copts" based on compiler (gcc vs clang) in Bazel

I have a Bazel-based C project and I want to compile it with both gcc and clang on Linux. To switch between compilers, I prefix the invocation with CC=<compiler, like so:CC=clang bazel build...

View Article

C project structure, code sharing and compiling code with dependencies

Hitherto, I had been writing all the code in a single file, so I never had to think of project structure and compiling code with dependencies. Now I am implementing priority queue that use heap code as...

View Article

Why is %eax zeroed before a call to printf?

I am trying to pick up a little x86. I am compiling on a 64bit mac with gcc -S -O0.Code in C:printf("%d", 1); Output:movl $1, %esi leaq LC0(%rip), %rdi movl $0, %eax ; WHY? call _printf I do not...

View Article


clang: error: assigning to 'int (*)[y][z]' from incompatible type 'int...

Why does clang (9.0.0) fail to compile this code? GCC (9.2.0) has no problems with it.Using typedef int arr[y][z]; arr *a; or auto a = ... works fine, but using the type inline gives the strange error...

View Article


Using -Wtype-limits with type generic code

I have a function that performs a negative check on a value of a generic type (well I don't want to assume the type, it is not necessarily templated). However, with -Wtype-limits enabled, the compiler...

View Article

Is it possible to have two fgets() as a condition of a while?

I'm working on a CRUD. II have to do it in standar ansi89. But the first, is to do a parser of a flat file(fixed width). I have 3 files, the inventory, the new items and a temporal one where i am going...

View Article

What are my available march/mtune options?

Is there a way to get gcc to output the available -march=arch options? I'm getting build errors (tried -march=x86_64) and I don't know what my options are.The compiler I'm using is a proprietary...

View Article

Only a gather loop is vectorized, not scatter, but I don't know why

I'm learning about vectorization and I don't know why this code is vectorized: for (i=0; i<N; i++) Y[i] = X[index [i]]; and this not: for (i=0; i<N; i++) X[index [i]]= Y[i]; I'm compiling with...

View Article


installed gcc and g++ on Mac mojave is not working (brew install)

I installed gcc by brew on Mac OS mojave, but both of gcc and g++ are not working.I tried compile below simple code by g++ but I got error messages.This program can be compiled correctly by default...

View Article

How to make compiler generate a "elf32-x86-64" format object file?

First, some background info about elf32-x86-64 format.It is a format that leverages 64-bit hardware while enforcing 32-bit pointers. Ref1 and Ref2.QuestionI am trying to link the Google Test framework...

View Article


How to fix "dangerous relocation: unsupported relocation"

I'm compiling linux-4.19(gcc-8.2 bintutils-2.31), however it always fails with errors like:aarch64-oe-linux-ld.bfd: drivers/platform/gsi/gsi.o: relocation R_AARCH64_ABS32 against...

View Article

Image may be NSFW.
Clik here to view.

How to fix "gcc isn't recognized as internal command" on Clion for Window?

I followed the Clion installation guide and I installed MinGW.So now I coded a C program and I try to type in the terminal gcc test.cbut I get gcc isn't a recognized internal commandHere is my program...

View Article


C++17 codecvt throw "bad conversion" when convert std::string to std::wstring

I wrote a string class called UString and I want is can convert std::string to std::wstring,and also convert std::wstring to std::string.I'm using the libary in c++17,so I wrote code as follows.In...

View Article

AVR gcc version < gcc release versions -- why?

I noticed that gcc for AVR lags behind the main development stream of gcc. For example, gcc for AVR8 is 4.9.2 in Atmel Studio 7 and Arduino, and AVR32 is at 4.4.7 in Atmel Studio. Meanwhile, gcc 4.9.4...

View Article

How to use const int in _Static_assert?

Preamble: I want to statically check amount of struct members in C program, so I created two macros, each of them creates constant int storing __LINE__ into variable: #include <stdio.h> #include...

View Article
Browsing all 21994 articles
Browse latest View live


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