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.
9,980
questions with no upvoted or accepted answers
18
votes
2
answers
2k
views
AddressSanitizer interceptor_via_fun
Would like to suppress the following error detected by AddressSanitizer.
==114064==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe60fee2f0 at pc 0x000001e6ef34 bp 0x7ffe60feb6c0 sp ...
16
votes
1
answer
7k
views
SYSV vs. Linux/GNU ELF formats
The question is in the context of the following question: Why are libraries not found, even though they are clearly on the -L path? . It seems that my libraries and my object file have a different ELF ...
14
votes
0
answers
2k
views
How to generate non-temporal instructions?
Intel's compiler has a pragma that can be used to generate non-temporal stores. For example, I can write
void square(const double* x, double* y, int n) {
#pragma vector nontemporal
for (int i=0; i&...
14
votes
0
answers
3k
views
pragma ignored in g++ and clang
I would like to disable specific known warnings in C++ code coming from a library header when compiling my own code. There are clang and gcc specific methods for disabling the warnings. The way this ...
13
votes
1
answer
12k
views
C/C++ VS Code extension throwing build error: "The task provider for "C/C++" tasks unexpectedly provided a task of type "shell"."
When I try to build a C task in VS Code it shows the following message:
The Output just shows this: The task provider for "C/C++" tasks unexpectedly provided a task of type "shell".
I can still ...
12
votes
1
answer
2k
views
Building gcc on BeagleBone Black fails
Problem
I am trying to build a cross compiler on a BeagleBone Black to compile from ARM to x86. The intent of this is to use the low power consuming BeagleBone Black that I had on hand as a build ...
11
votes
0
answers
1k
views
How can I suppress certain ABI change notes (embedded C++)?
In my project, I am getting many warnings of the form "note: parameter passing for argument of type 'SomeClass<int, float>' when C++17 is enabled changed to match C++14 in GCC 10.1".
...
11
votes
0
answers
1k
views
Is link-time section garbage collection useful with link-time optimization?
It is well-known that the gcc/ld options -ffunction-sections -fdata-sections -Wl,--gc-sections may reduce binary sizes (see for example answers to Query on -ffunction-section & -fdata-sections ...
11
votes
0
answers
392
views
How can I use BLAS on Windows with the GNU toolchain?
I have this dependency:
blas = "0.18.1"
During building this simple program (no types used de facto in the program):
extern crate blas;
use blas::c::*;
I get these errors:
error: linking with `...
11
votes
1
answer
475
views
Generic lambda, inheritance and trailing return type: is this valid code?
I was trying to reply to another answer and I found some difficulties while playing with lambdas and inheritance. Consider the following, minimal example:
template<typename Func>
struct Base: ...
11
votes
0
answers
1k
views
Has anyone successfully built a Cygwin version of GHC?
Has anyone successfully built a Cygwin version of GHC (since Haskell switched from using Cygwin to MinGW)?
From the haskell website:
"GHC targets MinGW, not Cygwin. It is in principle possible to ...
11
votes
1
answer
2k
views
Why arm-linux-gnueabi-gcc and not arm-none-eabi-gcc when compiling Linux kernel and uBoot?
I have some experience compiling bare metal code for ARM cortex-m devices as well as the Linux kernel, uBoot, and applications for the Beaglebone Black (BBB) (more featured ARM with MMU, for those ...
10
votes
0
answers
3k
views
gcc: Differences between -march=native and -march=<specific arch>
In order to compare which flags various -march settings will enable, I am comparing the outputs of the following commands, as detailed in this SO answer:
$ gcc -Q -march=native --help=target
$ ...
10
votes
1
answer
5k
views
[[maybe_unused]] attribute not working
I am trying to ignore the unused parameter warning using the new c++17 attribute [[maybe_unused]], as below.
int main([[maybe_unused]] int argc, char** argv)
{
//...
}
But I still get warning: ...
10
votes
1
answer
2k
views
STM32, Position independent code - function pointers not in GOT?
I need a position independent code (PIC) working on STM32F401. But i have problem with pointers to functions used e.g. in struct.
Short example:
struct process {
struct process *next;
const ...