Skip to main content
161 votes
3 answers
95k views

What is the difference between gcc -pthread and gcc -lpthread which is used while compiling multithreaded programs?
Vishnuraj V's user avatar
  • 2,879
13 votes
1 answer
1k views

If I have a chip that is subject to the Intel jcc erratum, how I can enable the mitigation in gcc (which adjusts branch locations to avoid the problematic alignment), and which gcc versions support it?...
BeeOnRope's user avatar
  • 66.3k
210 votes
6 answers
135k views

I'm compiling my C++ app using GCC 4.3. Instead of manually selecting the optimization flags I'm using -march=native, which in theory should add all optimization flags applicable to the hardware I'm ...
vartec's user avatar
  • 135k
86 votes
8 answers
104k views

Does __attribute__((always_inline)) force a function to be inlined by gcc?
HaltingState's user avatar
  • 1,930
191 votes
24 answers
108k views

Beyond setting -Wall, and setting -std=XXX, what other really useful, but less known compiler flags are there for use in C? I'm particularly interested in any additional warnings, and/or and turning ...
Matt Joiner's user avatar
78 votes
8 answers
29k views

Is there a way to see the compiler-instantiated code for a function template or a class template in C++? Assume I have the following piece of code: template <class T> T add(T a, T b) { ...
Vineel Kumar Reddy's user avatar
184 votes
8 answers
196k views

This note says: -ansi: tells the compiler to implement the ANSI language option. This turns off certain "features" of GCC which are incompatible with the ANSI standard. -pedantic: used in ...
huahsin68's user avatar
  • 7,019
309 votes
5 answers
201k views

I have heard from various sources (though mostly from a colleague of mine), that compiling with an optimisation level of -O3 in g++ is somehow 'dangerous', and should be avoided in general unless ...
Matt Dunn's user avatar
  • 5,470
8 votes
4 answers
35k views

I've been trying to compile a simple multithreaded piece of code I found online in an effort to learn how to multithread. To run this piece of code I need to use the compiler flags: -pthread and -std=...
user3201708's user avatar
136 votes
9 answers
316k views

I'd like to know what switch you pass to the gcc compiler to turn off unused variable warnings? I'm getting errors out of boost on windows and I do not want to touch the boost code: C:\boost_1_52_0/...
WilliamKF's user avatar
  • 43.6k
41 votes
6 answers
44k views

Where in Qt Creator do I pass arguments to a compiler? It isn't really that obvious.
smallB's user avatar
  • 17.3k
28 votes
3 answers
36k views

Eg: a common device module's Makefile obj-m:=jc.o default: $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules clean: $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(...
superK's user avatar
  • 4,002
5 votes
3 answers
12k views

After persistently getting error : identifier "atomicAdd" is undefined, I've found the solution to be to compile with -arch sm_20 flag. But how to pass this compiler flag in VS 2010? I have tried like ...
mchen's user avatar
  • 10.3k
29 votes
2 answers
6k views

When I compile my C++ program with g++ using the -Og option I see variables that are <optimized out>, and also the current line sometimes skips around. Is this behaviour expected at this ...
Svaberg's user avatar
  • 1,721
26 votes
6 answers
29k views

I have an OpenEmbedded environment using bitbake to do some builds. I wanted to get something "interactive" going on where bitbake would pause and ask for input then continue with the build but I've ...
Mike's user avatar
  • 49.8k

15 30 50 per page
1
2 3 4 5
8