The gcc tag has no wiki summary.
7
votes
2answers
1k 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 ...
19
votes
5answers
23k views
How to write a very basic compiler
Advanced compilers like gcc compile codes 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 each codes ...
5
votes
2answers
425 views
Larger Code is Still Faster
When compiling C code with gcc, there are compiler optimizations, some that limit code size and others create fast code.
From the -S flag, I see that the -O2/03 generates more assembly than the -Os ...
1
vote
1answer
345 views
register variable in C and C++
I know the concept of register variable and it's use cases but there are few questions in my mind based on what I have tried.
I cannot access the address of a register variable in C though I can do ...
16
votes
4answers
2k views
29
votes
3answers
6k views
Is GCC dying without threads support on Windows?
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 ...
7
votes
3answers
290 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 (...) */
...
3
votes
2answers
443 views
How do .so files avoid problems associated with passing header-only templates like MS dll files have?
Based on the discussion around this question. I'd like to know how .so files/the ELF format/the gcc toolchain avoid problems passing classes defined purely in header files (like the std library). ...
1
vote
2answers
315 views
GCC: assembly listing for IA64 without an Itanium machine
I need to try the following thing: I would like to compile some simple C code samples and see the assembly listing generated by GCC for IA64 architecture, i.e. I just want to run GCC with the -S ...
6
votes
2answers
757 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 ...
4
votes
3answers
487 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 ...
3
votes
3answers
3k views
Whether to use -pedantic flag in g++ or not?
I'm learning C++ and I'm using g++ on Linux for practicing.
1) I want to know if people working as programmers use g++ -pedantic flag and also it's importance in real world.
2) What about other ...