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

Angular 6 / declare path for library in tsconfig.lib.json

I'm trying to configure the paths for an Angular 6 library (I have successfully configured the paths for a previous Angular project) Here is what is working for my previous app in the tsconfig.json file: "compilerOptions": { [...] "baseUrl":…
Savannah
  • 103
  • 1
  • 1
  • 5
7
votes
2 answers

Get Python's LIB path

I can see that INCLUDE path is sysconfig.get_path('include'). But I don't see any similar value for LIB. NumPy outright hardcodes it as os.path.join(sys.prefix, "libs") in Windows and get_config_var('LIBDIR') (not documented and missing in Windows)…
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
7
votes
1 answer

How to import module from non-relative paths in Visual studio 2015

I am working on angular 4 project using gulp in Visual studio 2015. I got the Visual Studio 2015 QuickStart from here. tsc version: 2.5.2 My project structure: src └──angular └──common └──models └──items.ts …
7
votes
2 answers

Debug Flag With GCC (compile phase / link phase)

I have a this Makefile application= CXXFLAGS=-g -std=c++14 -Wall -Werror -pedantic LDFLAGS=-g auto: $(application) $(application): main.o aaa.o aab.o aba.o baa.o $(CXX) $(LDFLAGS) -o $@ $^ %.o: %.cpp $(CXX)…
Novice User
  • 91
  • 1
  • 3
  • 5
7
votes
2 answers

Why doesn't {$ifopt FINITEFLOAT ON} compile?

I have the construct: {$ifopt FINITEFLOAT ON} {$message 'FINITEFLOAT option ON' } {$else } {$message 'FINITEFLOAT option OFF' } {$endif } in my source and it won't compile! It's got to be something stupid. The error is: E1030 Invalid compiler…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
7
votes
2 answers

How to create string literal from -D compiler defined variable of a Windows path

Under Windows, I have an environment variable that contains a Windows-style path. I'd like to build that path into my program and print it out. So if my path is c:\top, I pass it into the compiler using -DTOP=$(TOP). Note I cannot convert it to…
shol74
  • 71
  • 3
7
votes
1 answer

Is there a gcc option to print the target triplet when cross-compiling?

gcc -dumpmachine is almost perfect, but it doesn't respect flags that affect the target. On the other hand, clang does: $ gcc -dumpmachine x86_64-unknown-linux-gnu $ gcc -dumpmachine -m32 x86_64-unknown-linux-gnu $ clang…
Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118
7
votes
1 answer

Javac: Option to compile without notes

Is there a compiler option for javac to compile without notes? I know of: -nowarn : to not display warnings -g:none : to generate no debugging info Notes are still generated with both of these. Is there a compiler option to not generate notes,…
franka
  • 1,867
  • 3
  • 17
  • 31
7
votes
1 answer

How can I understand the fdump-class-hierarchy output

I'm playing with fdump-class-hierarchy compiler option but I don't know how I can understand the output. What does the "size", "align", "base size" and "base align" mean, and how these are counted? Thanks! When the code is: class…
user19840919
  • 73
  • 1
  • 3
7
votes
2 answers

Break in Class Module vs. Break on Unhandled Errors (VB6 Error Trapping, Options Setting in IDE)

Basically, I'm trying to understand the difference between the "Break in Class Module" and "Break on Unhandled Errors" that appear in the Visual Basic 6.0 IDE under the following path: Tools --> Options --> General --> Error Trapping The three…
6
votes
1 answer

Use Kotlin compiler options for test sources in Android Studio

In my test sources I want to use some experimental Kotlin compiler feature to not see the lint warnings and errors for them in Android Studio. For example, I want to apply the following Kotlin options to all test sources. compileTestKotlin { …
Erik
  • 4,305
  • 3
  • 36
  • 54
6
votes
1 answer

Compiler switch to disable const_cast semantics in c-style casts?

Recently I stumbled over code such as this: void foo(const Bar* b) { ... takes_nonconst_param_fn((Bar*)b); ... Obviously, the developer didn't know what he was doing, but if the compiler hadn't silently accepted the c-style-cast and at least…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
6
votes
0 answers

Access maximum template depth at compile time?

In a certain compilation I need to play around with the option -ftemplate-depth=N that specifies the maximum template recursion. Is it possible to access the value of the maximum template depth from the program? I am interested in gcc or clang. $…
alfC
  • 14,261
  • 4
  • 67
  • 118
6
votes
1 answer

Warn about class member self-initialization

Have a look at this piece of C++ code: class Foo { int a; public: Foo(int b): a(a) {} }; Obviously, the developer meant to initialize a with b rather than a itself, and this is a pretty hard to spot error. Clang++ will warn about this…
Fabian Knorr
  • 3,134
  • 3
  • 20
  • 32
5
votes
1 answer

clang compiler options aren't documented?

For the sake of migrating compiler options to ARM using Xcode, I'm looking for a comprehensive documentation for clang c++ compiler/linker options. The closest I could get was this page, however: Many options aren't explained, e.g. -arch,…
gil_mo
  • 575
  • 1
  • 6
  • 27