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

Adding -fno-omit-frame-pointer option in ARMARCH5gnu in VxWorks leads to random crashes

Application crashes randomly when -fno-omit-frame-pointer option is added during compilation. This problem happens in ARMARCH5gnu architecture in VxWorks. Any pointers in the direction for resolving this will be helpful.
Jay
  • 24,173
  • 25
  • 93
  • 141
2
votes
1 answer

Can constexpr recursion limit be configured for clang or gcc?

Can constexpr compile-time recursion limit be configured through command line options for clang or gcc? How?
oblitum
  • 11,380
  • 6
  • 54
  • 120
2
votes
2 answers

Visual Studio 2010 Compiler Options

I can't find the option people call "C/C++" on Visual Studio 2010 Ultimate's Project Property Pages to change some compiler options. Here's what i got: I've tried creating an Empty Project and a Win32 Project set to empty with no result. Can anyone…
2
votes
1 answer

How to disable debug info for a generic type

I have following code (simplified): program Project1; {$APPTYPE CONSOLE} uses SysUtils, Unit1 in 'Unit1.pas'; var f: TFoo; begin f := TFoo.Create; f.Baz; Readln; end. unit Unit1; {$D-} interface type TFoo =…
Stefan Glienke
  • 20,860
  • 2
  • 48
  • 102
2
votes
1 answer

Supressing PDB generation from the command line - C++

I've had a search around and can find a few examples of using Visual Studio menus to suppress creation of PDB files. I need to do this for a project I'm building, however, this requires using the Visual Studio compiler from the command line only. Is…
Yuushi
  • 25,132
  • 7
  • 63
  • 81
2
votes
3 answers

How to set compiler options for activation groups in RPG or CL programs?

Is there any way to specify for a program source, what options for the activation group should be used during compilation? In most of our programs on the as/400 we need to change the handling of the activation group (since the default behaviour is…
kratenko
  • 7,354
  • 4
  • 36
  • 61
1
vote
1 answer

Compiling SDL and OpenGL inside of Code Blocks on Ubuntu

So anytime I compile my code using the terminal I have to compile with: -lSDL -lGL -lGLU How do I do this in Code Blocks? I have tried putting those into the build options for the project, but this did not fix anything. edit: I have also tried…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
1
vote
0 answers

Can /EHa exception option be used with c++20 module?

I know that the documentation says that "To consume the Microsoft Standard Library modules, compile your program with /EHsc and /MD options." https://learn.microsoft.com/en-us/cpp/cpp/modules-cpp?view=msvc-170 But I desperately hope that /EHa can be…
1
vote
0 answers

Detect C++ gcc/clang visibility setting at compile or run time?

I am trying to perform any of the following in C++: if( compiler_setting.find( "-fvisibility=hidden" ) ) { printf( "Default visibility is hidden\n" ); } if( compiler_setting.find( "-fvisibility-inlines-hidden" ) ) { printf( "Default…
1
vote
1 answer

How to configure delimiters in vue.js version 3+ using build tools?

I was stuck with this for a while. The official site gave this: // Delimiters changed to ES6 template string style app.config.compilerOptions.delimiters = ['${', '}'] but it doesn't work for build setup only as mentioned in the site.. it only…
1
vote
1 answer

Small build of amalgamated SQLite3 source

I'd like to use the compiler options described here to generate a smaller SQLite3 library. However, these options (including -Os it seems) expressly don't work with the amalgamated source, which is my preference. (I even tried all the same and…
Ken
  • 30,811
  • 34
  • 116
  • 155
1
vote
1 answer

Do all the OpenCL optimization-related options default to false?

An OpenCL implementation compiler takes (see specs for 2.2 or 3.0), among others, the following command-line…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
2 answers

Visual Studio: How to test (in code / static_assert) if a compiler option is enabled

I would like to check, in the code, if certain options where set at compile time. Specifically, I have implemented some exception handling and would like to use a static_assert to be sure the /EHa option was set in the Visual Studio compiler. (I am…
1
vote
1 answer

How can I influence the the source directory of an executable or library?

I recently noticed something odd when compiling the following C++ program: int main() { return 0; } using g++ on linux. Specifically, I compiled the program (located in /a/directory ) twice using the following two commands: g++ -g -o main main.cc…
hfhc2
  • 4,182
  • 2
  • 27
  • 56
1
vote
1 answer

Clang diagnostic flag with '#' causes a build error

In my cmake file I need to add a clang diagnostic flag that includes a #, as seen in clang docs for diagnostic flags. However cmake interprets # as a remark and fails. For example: add_definitions(-W#pragma-messages) is interpreted…
gil_mo
  • 575
  • 1
  • 6
  • 27