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
3
votes
2 answers

Link-time optimizations in CUDA 11 - what are they and how to use them?

The CUDA 11 features announcement, it's said that there are now: New link time optimization capabilities what link-time optimizations does nvcc actually employ (e.g. relative to the LTO capabilities in host-side code with g++ or clang++)? Also -…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
3
votes
1 answer

How do I use "-optimize" with dotnet cli?

Up until now I've been using csc.exe from .NET Framework to compile my short C# scripts. Nothing too fancy, I just wanted to explore a bit and the csc.exe was already on my computer. Now that I'm trying to write my projects using the .NET Core sdk…
Hurkus
  • 33
  • 4
3
votes
1 answer

How to prevent a member from being undefined within a constructor using TypeScript?

I have introduced a bug by writing a class like this: class SomeClass { private readonly item: string; constructor(item: string) { // bug, item is never assigned } public getInfo(): string { return this.item; //…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
3
votes
1 answer

Tensorflow C++ API is slow compared to Python

I am a Tensorflow enthusiast and I am trying to export a model (developed in Python and then frozen and optimized with the Tensorflow tools) for the usage (just for inference) within a C++ project. What I have experienced is that, even following…
3
votes
1 answer

How to pass compiler flags from Autoconf to Automake?

I'm having a heck of a time getting compiler options from Autoconf into Automake. Some of my source files have Automake per-object flags: ## Makefile.am librijndael_simd_la_SOURCES = rijndael-simd.cpp librijndael_simd_la_CXXFLAGS =…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
1 answer

IBM XL C/C++ equivalent to #pragma GCC optimize

We are experiencing bad code generation for a source file using IBM XL C/C++ at -O3 on PowerPC platforms. Its surfaces as a hang and it appears a particular loop is not broken. The problem only surfaces under XL C/C++. Our testing regime indicates…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
2 answers

what gcc compiler options can I use for gfortran

I studied Option Summary for gfortran but found no compiler option to detect integer overflow. Then I found the GCC (GNU Compiler Collection) flag option -fsanitize=signed-integer-overflow here and used it when invoking gfortran. It works--integer…
Kevin Powell
  • 591
  • 1
  • 5
  • 20
3
votes
2 answers

How to mark methods to be invoked only from the main thread in Obj-C?

I'm experimenting with the new Xcode 9 Main Thread Checker This is pretty neat. I'd like to now mark / annotate my Obj-C methods to be invoked only from the main thread so the Main Thread Checker can kick-in automatically when attached to the…
strangetimes
  • 4,953
  • 1
  • 34
  • 62
3
votes
5 answers

How do I force the size of a 'bool' under GCC

I'm currently porting some code from another platform and bools on the new platform are 1-byte sized. This is breaking our loading code as the values are stored as 32-bit values. Furthermore, speed is a critical issue on our platform and we would…
Grant Peters
  • 7,691
  • 3
  • 45
  • 57
3
votes
2 answers

Proper way of compiling OpenCL applications and using available compiler options

I am a newbie in OpenCL stuffs. Whats is the best way to compiler an OpenCL project ? Using a supported compiler (GCC or Clang): When we use a compiler like gcc or clang, how do we control these options? Are they have to be set inside the source…
Amir
  • 1,348
  • 3
  • 21
  • 44
3
votes
4 answers

C++ - Get Starting Address of a function from Ending Address / Get size of a function

I am using /Gh and /GH compiler option of visual studio to profile a bunch of code. Two methods used are _penter and _pexit which are called when a function is entered or exited in the code being profiled. Since I need specific functions being…
Taha Rehman Siddiqui
  • 2,441
  • 5
  • 32
  • 58
3
votes
0 answers

Static Library with _penter definition (/Gh) not recognized by project configuration type Dynamic Library dll

I have added the link of two projects, exactly same dummy code but different project types, first one is "Application (.exe)" {link to download} and the second one is "Dynamic Library (dll)" {link to download}. I am using Visual Studio Enterprise…
Taha Rehman Siddiqui
  • 2,441
  • 5
  • 32
  • 58
3
votes
1 answer

How do I set the compiler warning level for all projects in Visual Studio?

I am currently working on a software written in C++ that consists of 70+ projects in Visual Studio. I would like to increase the compiler level for all those projects without clicking through 70+ project property windows to set the new value for the…
Andreas
  • 5,393
  • 9
  • 44
  • 53
3
votes
2 answers

C/C++ Compiler that allows int width selection

Does anyone know of a modern native Windows C or C++ compiler that allows you to select between 16-bit and 32-bit type int? I encountered a cross-compiler back in the 80s that had this feature but I need a native compiler. As part of teaching my…
BenevolentDeity
  • 587
  • 6
  • 15
3
votes
1 answer

Compiler Additional Options computed in a custom Target

I have a msbuild custom Target and a Task computing a Value. The Task will output the Value as Property. This Property I would like to uses as Additional Option to the Compiler call. But the Property is empty when used as Additional Option. My…
mbusch
  • 53
  • 5