Questions tagged [gcc]
GCC is the GNU Compiler Collection. It's the de facto standard C compiler on Linux and supports many other languages and platforms as well.
42 questions
290
votes
7
answers
453k
views
How to write a very basic compiler
Advanced compilers like gcc compile code into machine readable files according to the language in which the code has been written (e.g. C, C++, etc). In fact, they interpret the meaning of the code ...
63
votes
9
answers
14k
views
Novice programmer(s) frustrated by lack of a glossary of compiler errors
A friend of my family asked me for a bit of help as he learns to program (in the C language). As we were talking, he expressed frustration about having a hard time understanding the error messages his ...
31
votes
3
answers
17k
views
Is GCC dying without threads support on Windows? [closed]
I need some opinion. GCC was always a very good compiler, but recently it is losing "appeal".
I have just found that on Windows GCC does not have std::thread support, forcing Windows users to use ...
27
votes
4
answers
14k
views
GCC vs clang/LLVM -- pros and cons of each [closed]
What are the pros and cons of GCC vs clang/LLVM?
23
votes
5
answers
22k
views
Whether to use -pedantic flag in g++ or not?
I'm learning C++ and I'm using g++ on Linux for practicing.
I want to know if people working as programmers use g++ -pedantic flag and also its importance in real world.
What about other compilers, ...
20
votes
2
answers
18k
views
Why glibc is maintained separately from GCC?
GCC is the C compiler. Glibc is the C library. However, isn't it an absolute necessity for a compiler and the standard library bundled together as a C implementation?
For example, the C library ...
13
votes
3
answers
12k
views
Isn't there a chicken-and-egg issue since GCC is written in C++ itself?
Since 4.8 release, the C++ compiler GCC (the G++ part of it) is written not in C anymore, but in C++ itself. I have a hypothetical question on this.
I wonder how to compile the C++ code of GCC on a ...
12
votes
6
answers
3k
views
Is there a way to use gcc as a library?
Anyone knows a solution that works something like this:
#include <stdio.h>
#include <gcc.h> /* This .h is what I'm looking for. */
int main (void) {
/* variables declaration (...) */
...
11
votes
2
answers
19k
views
Why C allows multiple global declarations of the same variable but NOT multiple local declarations?
I noticed that if I declare a global variable multiple times the compiler does not even output a warning.
However if I declare a local variable in a function multiple times, for example, the gcc ...
10
votes
1
answer
4k
views
Why does GCC use AT&T syntax by default?
I think title says it all :)
Is there any particular practical reason (I guess it's mostly historic, but I'm unable to find it on my own) why GCC uses AT&T/GAS syntax?
Note: I know this is just ...
9
votes
2
answers
3k
views
Questions about linking libraries in C
I am learning C (still very much a beginner) on Linux using the GCC compiler. I have noticed that some libraries, such as the library used with the math.h header, need to be linked in manually when ...
8
votes
1
answer
16k
views
Difference between direct and indirect function() calls
I am curious about the Difference between direct and indirect function() calls
Could anyone help in the diff analysis ?
The c source code could be found at subroutine_direct.c and ...
8
votes
2
answers
885
views
Is it wise to use Clang for personal code analysis in a project that builds with gcc?
I started to work on several C projects that are building using gcc. I believe this choice was made for several reasons:
Had to cross-compile for arm very early on (I think).
Performance is the first ...
7
votes
3
answers
2k
views
Does using GCC specific builtins qualify as incorporation within a project?
I understand that linking to a program licensed under the GPL requires that you release the source of your program under the GPL as well, while the LGPL does not require this. The terminology of the (...
7
votes
2
answers
3k
views
Need help eliminating dead code paths and variables from C source code
I have a legacy C code on my hands, and I am given the task to filter dead/unused symbols and paths from it. Over the time there were many insertions and deletions, causing lots of unused symbols. I ...