Top "Compiler-flags" questions

Parameters that may be passed to a compiler affecting how compilation is carried out.

How do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?

I'd like to know what switch you pass to the gcc compiler to turn off unused variable warnings? I'm getting …

c++ gcc compiler-warnings compiler-flags
Is optimisation level -O3 dangerous in g++?

I have heard from various sources (though mostly from a colleague of mine), that compiling with an optimisation level of …

c++ optimization g++ compiler-flags
How to see which flags -march=native will activate?

I'm compiling my C++ app using GCC 4.3. Instead of manually selecting the optimization flags I'm using -march=native, which in …

gcc g++ compiler-optimization compiler-flags
Changing CMAKE_CXX_FLAGS in project

I have the following content in my CMakeLists.txt: project( Matfile ) SET ( CMAKE_CXX_FLAGS "-std=c++0x" ) set ( SOURCES "…

cmake compiler-flags
Optimization and flags for making a static library with g++

I am just starting with g++ compiler on Linux and got some questions on the compiler flags. Here are they …

c++ optimization g++ compiler-flags
Useful GCC flags for C

Beyond setting -Wall, and setting -std=XXX, what other really useful, but less known compiler flags are there for use …

c gcc compiler-flags
How do I force gcc to inline a function?

Does __attribute__((always_inline)) force a function to be inlined by gcc?

gcc inline compiler-flags
Difference between -pthread and -lpthread while compiling

What is the difference between gcc -pthread and gcc -lpthread which is used while compiling multithreaded programs?

multithreading gcc thread-safety pthreads compiler-flags
Does set_target_properties in CMake override CMAKE_CXX_FLAGS?

At the beginning of my CMake project, I'm setting general compilation flags in the variable CMAKE_CXX_FLAGS, like set(…

c++ cmake compiler-flags
gcc optimization flags for Xeon?

I'd want your input which gcc compiler flags to use when optimizing for Xeons? There's no 'xeon' in mtune or …

c++ c optimization gcc compiler-flags