Questions tagged [compiler-options]

Compiler-options are parameters that are being passed to the compiler and that affect the compilation process or its resulting product.

Modern compilers have a large set of options that can be used to somehow change the way the code is compiled. Usually those options are passed as command-line flags.

Example for Java:

javac -target 1.5 -bootclasspath jdk1.5.0\lib\rt.jar \ -extdirs "" OldCode.java

More information about particular options can be found on compiler vendor's websites, to name a few:

244 questions
317
votes
12 answers

How to compile Tensorflow with SSE4.2 and AVX instructions?

This is the message received from running a script to check if Tensorflow is working: I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:125]…
GabrielChu
  • 6,026
  • 10
  • 27
  • 42
152
votes
7 answers

What does the fpermissive flag do?

I'm just wondering what the -fpermissive flag does in the g++ compiler? I am getting: error: taking address of temporary [-fpermissive] which I can solve by giving the -fpermissive flag to the compiler. EDIT: I just found what was causing the…
mmirzadeh
  • 6,893
  • 8
  • 36
  • 47
101
votes
7 answers

How to disable compiler optimizations in gcc?

I am trying to learn assembly language. I have searched and found how to disassemble a .c file but I think it produces some optimized version of the program. Is there any way so that I can see the exact assembly code which corresponds to my C file.
Neal
  • 3,119
  • 4
  • 27
  • 32
85
votes
4 answers

msbuild, defining Conditional Compilation Symbols

I'm possibly just blind, but is there a command line to specify conditional compilation symbols in MSBUILD? I currently have this Line in my buildscript: SET MSBUILD=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe SET…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
81
votes
2 answers

What is the difference between the /Ox and /O2 compiler options?

Microsoft's C++ compiler (cl.exe, as included with Visual Studio) offers several optimization switches. The difference between most of them seems self-explanatory, but it's not clear to me what the difference is between /O2 (which optimizes code for…
78
votes
2 answers

"Register for COM Interop" vs "Make assembly COM visible"

What is the real difference between these two options? What I know is: Register for COM Interop This options executes regasm on the assembly and registers the assembly as an COM component(or maybe not) in the registry with all COM like registry…
A9S6
  • 6,575
  • 10
  • 50
  • 82
77
votes
6 answers

When should I use GCC's -pipe option?

The GCC 4.1.2 documentation has this to say about the -pipe option: -pipe Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read…
Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
62
votes
3 answers

What's the difference between GNU99 and C99 (Clang)?

I have saw the compiler option GNU99 and C99. What's the difference of them? Any detail documentation? (Clang, Xcode, Mac OS X)
eonil
  • 83,476
  • 81
  • 317
  • 516
49
votes
5 answers

How to tell if a .NET application was compiled in DEBUG or RELEASE mode?

I have an application installed on my computer. How do I find out if it was compiled in DEBUG mode or not? I've tried to use .NET Reflector, but it does not show anything specific. Here is what I see: // Assembly APPLICATION_NAME, Version…
Alex
43
votes
1 answer

Difference between add_compile_options and SET(CMAKE_CXX_FLAGS...)

This question is related to Instruct Cmake to use CXX and CXXFLAGS when driving link? In the former question, we are trying to instruct CMake to use CXXFLAGS when it invokes the linker. add_compile_options We found that the following code if…
jww
  • 97,681
  • 90
  • 411
  • 885
29
votes
3 answers

Adjust Variable Tracking Assignment Length

In a release build I'm getting the following informational warning from GCC 4.4.7. note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without Have I exceeded the variable name length supported by variable…
oz10
  • 153,307
  • 27
  • 93
  • 128
27
votes
1 answer

What's the difference in GCC between -std=gnu++0x and -std=c++0x and which one should be used?

I'm having troubles with when using -std=c++0x in GCC 4.4.3 (for Android): // using -std=c++0x #include uint64_t value; // error: 'uint64_t' does not name a type But using -std=gnu++0x works: // using -std=gnu++0x #include…
Meh
  • 7,016
  • 10
  • 53
  • 76
24
votes
2 answers

The g++'s -g option equivalent to VS2010 cl compiler?

With g++ with -g option, I can use gdb for debugging purposes. What's the equivalent to this option with Visual Studio 2010 cl.exe compiler? This page has different libraries (debug/release) for linking. If I compile with debugging option with…
prosseek
  • 182,215
  • 215
  • 566
  • 871
23
votes
2 answers

How can I get the nvcc CUDA compiler to optimize more?

When using a C or C++ compiler, if we pass the -O3 switch, execution becomes faster. In CUDA, is there something equivalent? I am compiling my code using the command nvcc filename.cu. After that I execute ./a.out.
user12290
  • 621
  • 1
  • 5
  • 13
23
votes
4 answers

Possibility of Suppressing any error (e.g. incl. TS7017) within a config file (e.g. tsconfig.json)

I would like to suppress any desired error; TS7017 is only an example. Maybe it is possible now? Can TypeScript v4++ help? I want to achieve something like (e.g., in the compilerOptions in tsconfig.json): // ATTENTION PSEUDO CODE suppressErrors:…
user3025289
1
2 3
16 17