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
10
votes
1 answer

What's the differences between -m32, -m64, and nothing in gcc's options?

gcc -m32 main.cpp gcc -m64 main.cpp gcc main.cpp What's the differences between -m32, -m64, and nothing in gcc's options?
xmllmx
  • 39,765
  • 26
  • 162
  • 323
10
votes
1 answer

Passing multiple -std switches to g++

Is it safe to assume that running g++ with g++ -std=c++98 -std=c++11 ... will compile using C++11? I haven't found an explicit confirmation in the documentation, but I see the -O flags behave this way.
krlmlr
  • 25,056
  • 14
  • 120
  • 217
10
votes
2 answers

Disabling C++0x features in VC 2010?

Does C++0x mode in VC++ 2010 has an off switch? I am working on a project that supposed to compile on non 0x compilers, and therefore I want to compile against the current standard. (Even if non of the new features are being used directly, there are…
uj2
  • 2,255
  • 2
  • 21
  • 32
10
votes
2 answers

Why do common C compilers include the source filename in the output?

I have learnt from this recent answer that gcc and clang include the source filename somewhere in the binary as metadata, even when debugging is not enabled. I can't really understand why this should be a good idea. Besides the tiny privacy risks,…
10
votes
1 answer

Automated F# Signature File (.fsi) Generation

I am working on a project that has a number of modules that I'd like to apply access control constraints to. I'd also like to have my project contain additional documentation on the type signatures of each function. I know that I can accomplish…
Impl0x
  • 103
  • 5
10
votes
3 answers

Does GCC/Clang's -framework option work on Linux?

On OSX's development environment there is the concept of frameworks. A framework is a kind of bundle which contains headers, shared libraries and other useful stuff. A framework can be passed to the compiler, so that the compiler includes its…
LuisABOL
  • 2,951
  • 4
  • 25
  • 57
9
votes
8 answers

Qmake: how to remove compiler flag for a certain project, without changing qmake.conf?

I'm using qmake and Visual Studio. In release build qmake adds /GL and /O2 flags to all projects, and I need to remove those two flags for certain libraries within my whole Qt project. Is there a way?
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
9
votes
1 answer

Can someone provide an example of how javac's -implicit option works?

At the shell command prompt, if I type in javac -help, it tells me that the -implicit option specifies "... whether or not to generate class files for implicitly referenced files". There are two options that go with -implicit: none or…
user2911290
  • 1,396
  • 1
  • 16
  • 26
9
votes
3 answers

Which gcc options reduce code size?

I'm constrained by a 128Kb limit executable size for an embedded PowerPC system. Unfortunately, using option -Os to optimize for size does not work due to what I believe is a compiler bug (link with -Os fails due to undefined reference to…
Jens
  • 69,818
  • 15
  • 125
  • 179
9
votes
4 answers

How to know which headers are included without looking at the preprocessed code in GCC?

I've got some big C programs, and I would like to know when I'm compiling this program, which header files are actually included... The simplest solution would be to print the preprocessed code and look but do you know if there's a way to compile…
LB40
  • 12,041
  • 17
  • 72
  • 107
8
votes
9 answers

C#: Benefit of explicitly stating "unsafe" / compiler option

I understand pointers and the rare need to use them in C# code. My question is: what is the reasoning behind having to explicitly state "unsafe" in a block of code. Additionally, why must a compiler option be changed to allow "unsafe" code? Bottom…
Inisheer
  • 20,376
  • 9
  • 50
  • 82
8
votes
3 answers

Visual C++ Compiler Optimization Flags: Difference Between /O2 and /Ot

What's the difference between the /Ot flag ("favor fast code") and the /O2 flag ("maximize speed")? (Ditto with /Os and /O1.)
user541686
  • 205,094
  • 128
  • 528
  • 886
8
votes
1 answer

How do I find the latest Typescript target support for any version of node?

Assuming any version of Node, how do I find the corresponding Typescript Compiler Option for target that gives most the functionality? I want to remove the guest work. Specify ECMAScript target version: "ES3" (default), "ES5", "ES6"/"ES2015",…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
8
votes
1 answer

Is there a way to obtain elided lifetime parameters from the Rust compiler?

Given a Rust program, which compiles correctly, can I get the compiler to tell me what the elided lifetimes were inferred to be?
Peter Hall
  • 53,120
  • 14
  • 139
  • 204
7
votes
2 answers

Google protocol buffers cross compiling

My problems of using Google protocol buffers has two parts, one is about compiler options, another is cross compiling. The build machine is a Power6, 64bit; host machine is a PowerPC450, 32bit. Gcc 4.1.2. First problem is about compiler options: I'm…
Tony
  • 453
  • 4
  • 7
  • 16
1 2
3
16 17