Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [gcc]

GCC is the GNU Compiler Collection. It's the de facto standard compiler for C, C++, Go, Fortran, and Ada on Linux and supports many other languages and platforms as well.

gcc
0 votes
1 answer
56 views

Passing `volatile` buffers to library functions which do not take `volatile`

I have a multi-processor system with a "shared" memory region used for communication. In some cases one of the processors needs to process some considerably large data in the shared memory ...
Eugene Sh.'s user avatar
  • 18.1k
0 votes
0 answers
21 views

Problems compiling CMSIS-RTOS library in ARM A7 firmware

I'm writing a firmware for STM32MP135 A7 ARM micro. I'd like to include CMSIS-RTOS2 libraries and compile a simple basic program (to blink 2 LEDS in 2 different threads) by gcc cross toolchain and ...
SteMMo's user avatar
  • 408
0 votes
0 answers
20 views

Libsanitizer Error When Building GCC Cross-Compiler

I'm encountering compilation issues while building a GCC cross-compiler for RISC-V. Here is the last part of the GCC make command output if it might be helpful: ../../../../../src/gcc-14.1.0/...
lotobis's user avatar
2 votes
2 answers
91 views

C++ Compile-Time Class With std::vector Member Variable and Use It's Data at Run-Time [duplicate]

I am trying to make a writer class, which would be used to turn data into a binary stream, at compile-time using a std::vector, and then converting it to std::array to be used at runtime. eg: #include ...
user15137921's user avatar
0 votes
1 answer
31 views

Tensorflow 2.17.0 build failed with bazel linux

I download the source code of tensorflow-2.17.0 from github, then i run 'configure' and build with bazel-6.5.0 successfully, > bazel build //tensorflow/core:tensorflow then i create a folder 'test'...
WardenAllen's user avatar
1 vote
0 answers
54 views

No compile time errors or warnings are being shown on my terminal window in vs code

I am using c language and I am working on windows using gcc compiler..I have also installed extensions like code runner and c\c++ Microsoft one too. For example, If I put an assignment operator in the ...
Jasmeet Kaur's user avatar
0 votes
1 answer
26 views

When cross-compiling for an ARM embedded target using GCC, is it reasonable to expect the Windows and Linux versions to produce identical output?

I have a build for an ARM embedded target that is developed using eclipse and GCC toolchain release 12.2-rel1. I have set up a build in TeamCity that runs in a Linux-based Docker container, also using ...
Tim Long's user avatar
  • 13.7k
1 vote
0 answers
34 views

C - Packed struct - different behavior in different compilers

I've wrote a function that writes file-info into another file (in bin-format). I've built it for WINDOWS executable, in two different environments: eclipse, using mingw gcc: GCC: (MinGW.org GCC-6.3.0-...
LYB's user avatar
  • 23
-1 votes
0 answers
17 views

Im new to C++ idk how to run the code and im getting some errors

I am new to C++ because I've been using python and I just learned how to install packages with vcpkg and I installed dpp/dpp.h but when I put it in a file it says it recognizes the package but as ...
IG2MB's user avatar
  • 1
1 vote
0 answers
36 views

Correct Method to Place Multiple Arrays in a Custom Flash Section in C using GCC

I need to store a constant array in flash memory at a specific location using GCC in my embedded C project. For a uint32_t value, I managed to do it like this, and it works: const uint32_t ...
WITC's user avatar
  • 197
-1 votes
0 answers
17 views

Error while compiling with makefile and gcc [closed]

I'm new to this forum, so please forgive me for any mistakes. I'm encountering an error while compiling a project created with CubeMX 6.12.0. The error message is: make[1]: arm-none-eabi-gcc: Argument ...
massimo perdigo's user avatar
0 votes
0 answers
13 views

Why does clang fail on mabi but not gcc?

Given my file test.c: #include <stdarg.h> int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); } I try: $ clang -m64 -c -g -O2 -mabi=ms test.c -Wall -Wextra which ...
theEpsilon's user avatar
  • 1,879
0 votes
0 answers
14 views

How to use gcc compiler on Github windows runners when using scikit-build-core [duplicate]

I'm using scikit-build-core to build my c++ program on github windows runners. I would like to use gcc instead of microsoft visual studio as the compiler. Below is how I configure compiler settings in ...
Jiawei Lu's user avatar
  • 537
-1 votes
0 answers
32 views

i386-elf-gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory

I have this c code: extern "C" void main() { *(char*)0xb8000 = "Q"; return; } and when I try to compile it whit this command: i386-elf-gcc -ffreestanding -m32 -g -c "...
Nicolas Prigge's user avatar
0 votes
1 answer
80 views

why huge local variable array doesnt cause segment fault

#include<iostream> using namespace std; int main() { char arr[40960]; for(auto i =0;i<40960;++i) arr[i]='c'; std::cout<<sizeof(arr)<<std::endl; ...
Rain's user avatar
  • 47
1 vote
1 answer
29 views

how to compile MinGW32 for C-SKY processors?

for C-SKY processors there is an IDE CDS for Windows, it uses MinGW, but it has a very old version of GCC 6.3, I would like to update to 13.2, how to do this correctly? I tried to google and didn't ...
Andynvkz's user avatar
0 votes
1 answer
24 views

compiling errors for R 4.4.1 on alma linux 9.4

I am compiling R 4.4.1 from source on alma linux 9.4 (docker container) ./configure --prefix ${installdir} \ --enable-year2038 --with-cairo --with-x --with-libpng --with-jpeglib --with-libtiff \ ...
laura_poggio's user avatar
1 vote
1 answer
70 views

gcc and clang disagree on using alias templates as template template argument [duplicate]

The code below compiles using gcc 14.1.1 but clang 18.1.8 doesn't accept it. Which one is right and is there any workaround? template <template <typename...> class T> struct s { ...
R.J's user avatar
  • 424
0 votes
0 answers
35 views

How to build and Install compiler g++-4.8.5 on ubuntu 24.04 from source code?

I am getting error while building gcc-4.8.5 on ubuntu 24.04 I had followed the below steps as mentioned in the page How to Install compiler g++-4.8.5 in ubuntu 20.04 sudo dpkg --add-architecture i386 ...
Prabhu634's user avatar
0 votes
0 answers
21 views

Unable to generate intermediate .i files (preprocessed files) in Linux kernel

In Linux kernel, I need to analyze the source code files, I choose intermediate .i files (preprocessed files) to analyze because of the macro definitions (preprocessed files have the macro definitions ...
XI HUANG's user avatar
0 votes
0 answers
11 views

gcovr cant process file

I am trying to generate a some coverage reports using gcov and gcovr, but gcovr fails to process my files. The compile line for a particular file is the following "command": "/usr/bin/...
jjcasmar's user avatar
  • 1,603
0 votes
0 answers
40 views

cc -o out out.s on macOS with M1 chip

I have been learning the chapter of 04_Assemblyhttps://github.com/DoctorWkt/acwj/tree/master/04_Assembly. According to the README.md, after I typed cc -o comp1 -g cg.c expr.c gen.c interp.c main.c ...
ge1mina023's user avatar
0 votes
0 answers
68 views

Error cross compiling on windows 64 bit to x86 32bit with i368-gcc - "Warning: .type pseudo-op used outside of .def/.endef ignored."

I'm trying to make a simple os that uses the x86 32 bit architecture, my kernel is the following: kernel.c: void dummy_test_entrypoint() { } void main() { char* video_memory = (char*) 0xb8000; ...
Tedy koud's user avatar
1 vote
1 answer
50 views

Setup libstdc++ for a given gcc version

New to Linux here. Already had gcc 11 and 12 on my ubuntu but compiled gcc-14 using following command: ./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --...
Xemuth's user avatar
  • 447
0 votes
0 answers
59 views

How to locate the file that defines specific symbol through #define in C++?

For example, I want to locate the header file that defines _WIN32_WINNT, how can I do? I tried g++ -E but it does not work. Note that there may be multiple definitions of the same symbol. I want to ...
William's user avatar
  • 935
0 votes
1 answer
29 views

Why CSAPP say Gcc do not use vcvtss2sd?

Computer Systems: A Programmer's Perpective (3rd), in section 3.11.1, say "Suppose the low-order 4 bytes of %xmm0 hold a single-precision value; then it would seem straightforward to use the ...
TouXianGuan's user avatar
0 votes
0 answers
32 views

Need to convert a Visual studio C++ project to a Cmake [duplicate]

I have a c++ code repo it has almost 68 projects within it. It was initially created using MSVC. I need to build that same project with gcc using cmake. Is there a way to convert that to a CMAKE ...
Nesan Mano's user avatar
  • 2,126
1 vote
1 answer
23 views

Understanding GCC Compilation: Preprocessing vs Linking with Libraries

I have a question regarding compilation with GCC. I have a slight confusion that I believe I've figured out but would like confirmation on. In the first compilation step, preprocessing (cpp) organizes ...
DLR's user avatar
  • 11
0 votes
0 answers
32 views

Different execution times for the same code

I'm working with the Texas Instruments (TI) RM57L843 microcontroller, where I'm observing the execution time of a for loop that performs matrix multiplication. I compiled the same code using TI's ...
Dan's user avatar
  • 1
0 votes
1 answer
58 views

How to compile and run a C script in MSYS2

beginner programmer here, I am trying a rudimentary approach, where I write some c code in a text editor (notepad++) and wish to compile it using gcc. The way to do this I found would be to install ...
Yordan Aleksandrov's user avatar
0 votes
1 answer
16 views

STM32CubeIDE: How to exclude memory sections in linker script from output file

In my cube project, I need to generate a bin file as the output. The output bin file is over 2GB because it includes a RAM section (0x30000000) in the output as well as the required flash section (...
ethan's user avatar
  • 25
-2 votes
0 answers
48 views

growisofs - How do I fix the errors returned by attempting to compile it in cygwin? [closed]

Context: I'm attempting to build growisofs from its source code (version 7.1) using the following command in the Cygwin terminal: make TARGET_ARCH=-m64, but it gives me several errors when I attempt ...
moochandaleech's user avatar
1 vote
1 answer
79 views

Why do I get a "for declaration does not refer into a class, class template or class template partial specialization" on Clang and not GCC [duplicate]

I currently have this block of code which does not throw a compiler error on GCC, but throws this compiler error on clang: error: nested name specifier 'MyEnum::' for declaration does not refer into ...
Moe Bataineh's user avatar
  • 1,080
1 vote
0 answers
18 views

Select specific version present in ld version script

Consider the setup present in this question: GNU LD symbol versioning & C++ binary backwards-compatibility Consider the version script. Is it possible to explicitly tell ld to limit the exposed ...
fusiled's user avatar
  • 309
3 votes
2 answers
109 views

GCC 14 "possibly dangling reference to a temporary" warning or not, depending on the function argument

In the following C++ code GCC 14 with -Wall -Wextra flags produces a possibly dangling reference warning for function g(), but not f(). Why? /* getval.h */ #include <string> std::string const &...
akryukov's user avatar
0 votes
0 answers
19 views

Memcpy specified bound exceeds maximum object size - gcc bug?

I'm getting a very weird warning when trying to compile Fribidi with gcc. Take a look at the following line: memcpy (visual_str, str, len * sizeof (*visual_str)); (source) It triggers this gcc ...
Andreas's user avatar
  • 9,769
-2 votes
0 answers
54 views

Address sanitizer CHECK failed [closed]

I am writing a program using the gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux toolchain. There is a task to check if there are any memory leaks in the program. I saw in tutorials that adding ...
Waldemar _'s user avatar
1 vote
1 answer
65 views

dSYM not generated when building with make

On macOS 12.7.5 (Monterey) using gcc to compile *.c: gcc version 13.2.0, with gnu make 3.81, (I prefer command line tools over XCode), when I pass CFLAGS = -g in a makefile I get full debugging ...
perlboy's user avatar
  • 106
1 vote
1 answer
43 views

Failing to compile package from Mac [duplicate]

I'm trying to install a package in R, and I get the following error: clang: error: unsupported option '-fopenmp' This, is after I got an error: ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-...
Kozolovska's user avatar
  • 1,109
1 vote
2 answers
111 views

Why exception can not be caught on windows by msvc but on Linux by GCC [duplicate]

The same files on Windows and Linux as follow: std_exp.cpp #include <iostream> #include <string> #include <stdexcept> using namespace std; int main() { try { std::...
Monhde Sau Hung's user avatar
0 votes
0 answers
21 views

Why does AddressSanitizer not produce any backtrace sometimes?

After compiling and linking my program with gcc 11.4 using -fsanitize=address and -g, I am getting an AddressSanitizer report on the console, but no backtrace like usual. Running under gdb does not ...
Haydentech's user avatar
  • 1,148
-3 votes
0 answers
44 views

mingw32/bin/ld.exe: cannot find -lomp

I'm trying to test a program in C for a friend to compare performances of the "sieve of Eratosthenese". I'm testing it in Visual Studio Code and in the terminal, they tell me to put this in ...
Crimsora's user avatar
3 votes
0 answers
143 views

GCC optimizes x + n > y as x + (n-1) >= y?

In general, the program extern int x, y; int main() { return x + N > y; } is optimized into something akin to x + N-1 >= y for some given N. Example below. Am I reading the assembly right? ...
b44ken's user avatar
  • 31
-2 votes
0 answers
73 views

Only the First Line of Output is Printed in C Program in VS Code on Windows Using MinGW

In C program only the first line of output is printed when I run the compiled executable. Despite the program compiling without errors, the subsequent lines do not appear. Details: Operating System: ...
BinaryBard's user avatar
0 votes
0 answers
19 views

Why is CMake not using the specified toolchain? [duplicate]

I'm trying to compile a binary for a atmega328p-based board using the AVR 8-bit toolchain via CMake. I'm on windows. My cmake command is: mkdir build cd build cmake --toolchain C:\Users\Me\src\alarm-...
MHebes's user avatar
  • 2,925
0 votes
2 answers
111 views

GCC compiler handles "char * str" and "char str[]" with the & operator differently [duplicate]

The compiler treats the types char * var and char var[] differently when it comes to taking the address of a variable via the & operator. Here's a little snippet of code to demonstrate: #include &...
gilfoyle's user avatar
1 vote
1 answer
58 views

gnu inline assembly constraint `i` for memory address

Recetly, this function rip_rel_ptr has been added to Linux kernel. https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/asm.h#L118. I can compile the kernel, but when I copy this ...
amrzar's user avatar
  • 367
1 vote
0 answers
77 views

/usr/bin/ld multiple definition of during compile

I just want to mention that I didnt write this code or modify it in any way prior to trying to compile it. I have just been copying the source from EL5 to 6 to 7 and compiling it. I think when it went ...
ZCT's user avatar
  • 329
0 votes
1 answer
29 views

Calling Conventions and Register Selection

I've been delving into compiler theory, and how do they really compile source code into machine code. Though, there is something that all papers about register selection seem to ignore, and I'm not ...
Rui Pedro's user avatar
0 votes
0 answers
13 views

Cmake 3.17.5 (Centos7): using ISO C90 whereas CMAKE_CXX_STANDARD=11 [duplicate]

I have a simple program I compile with make via CMake. The CMakeLists.txt contains set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) but I get lots of warnings and errors. warning: ISO ...
None's user avatar
  • 2,364

15 30 50 per page
1
2 3 4 5
836