Questions tagged [compiler-flags]

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

479 questions
12
votes
1 answer

Specify ghc options at command line via cabal (cabal-install) without editing .cabal files of packages

When I install vector with: cabal install vector I get lots of SpecConstr limit warnings which would go away if I could specify -fspec-constr-count=SOMETHING-HIGHER. Would cabal install vector -fspec-constr-count=HIGH work? If X depends on…
Cetin Sert
  • 4,497
  • 5
  • 38
  • 76
11
votes
2 answers

How to tell gcc to keep my unused labels?

Edit: Thanks to @NateEldredge, I better defined my question in How to 'tag' a location in a C source file for a later breakpoint definition? I use those labels to setup breakpoints in gdb. So no matter if I add/remove lines of code after/before the…
onlycparra
  • 607
  • 4
  • 22
11
votes
1 answer

How can I mitigate the impact of the Intel jcc erratum on gcc?

If I have a chip that is subject to the Intel jcc erratum, how I can enable the mitigation in gcc (which adjusts branch locations to avoid the problematic alignment), and which gcc versions support it?
BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
11
votes
3 answers

How to disable scaling the UI on Windows, for Java 9 applications?

There was no proper HiDPI support in Java 8. In Java 9, JavaFx applications correctly scale to the monitor they are in. For example, if my monitor is set to scale at 150%, the Java application is scaled to 150%. See:…
Marcelo Glasberg
  • 29,013
  • 23
  • 109
  • 133
11
votes
1 answer

What is the purpose of EXTRA_CFLAGS?

What is the intended use of EXTRA_CFLAGS? I see it in some contexts but I've never understood why one wouldn't just append flags to CFLAGS instead of EXTRA_CFLAGS. I first thought there was something to do with how make has defined its implicit…
Marcus Johansson
  • 2,626
  • 2
  • 24
  • 44
11
votes
1 answer

Xcode 5 equivalent of NS_BLOCK_ASSERTIONS in Build Settings

Until Xcode 5, Release builds could be prevented from including NSAssert statements and their variants, using the default Build Setting: OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; This setting can be found in project.pbxproj and is set in Xcode…
Max MacLeod
  • 26,115
  • 13
  • 104
  • 132
11
votes
2 answers

Disable -Wall compiler warnings in a Qt project?

I am compiling a 3rd party library and don't care to fix the warnings present in the library, but I don't want them polluting the Issues pane in Qt Creator. I've tried following the advice here, but there is no compiler flag to disable -Wall after…
Cory Klein
  • 51,188
  • 43
  • 183
  • 243
10
votes
1 answer

-I Flag in GCC ( Linux )

I Have found a source file bundle with a Makefile, I went through it, and In CFLAG Variable, There is a FLAG -I , I have searched on the web, But couldn't find what it actually does. Is it something relevent to the library files included in the C…
Fawzan
  • 4,738
  • 8
  • 41
  • 85
10
votes
3 answers

How can I view assembly code produced for C functions?

I need to view the assembly code produced for certain C functions. What flags should I use when compiling the C code using the g++ compiler?
Syntactic Fructose
  • 18,936
  • 23
  • 91
  • 177
10
votes
1 answer

When to use certain optimizations such as -fwhole-program and -fprofile-generate with several shared libraries

Probably a simple answer; I get quite confused with the language used in the GCC documentation for some of these flags! Anyway, I have three libraries and a program which uses all these three. I compile each of my libraries separately with…
James
  • 173
  • 2
  • 6
9
votes
6 answers

Disadvantages of using the `-Wextra` flag when compiling in GCC

I know that one should always compile with both -Wall and -Wextra as they enable warnings and help us to understand our mistake, if any. I've read that the -Wextra compiler flag is not recommended to use because it is too verbose with a lot of false…
Spikatrix
  • 20,225
  • 7
  • 37
  • 83
9
votes
5 answers

Arduino 1.0.6: How to change compiler flag?

I'm currently working on a project using Arduino 1.0.6 IDE and it does not seem to accept C++11 std::array. Is it possible to change the compiler flag to make this work?
9
votes
1 answer

Using compiler variables in Swift

In Objective-C I had a bunch of compiler flags set in Build Settings -> Other C Flags that were being used in the code. For instance: Flag => -DPortNumber = 1 And in code I was able to access it by @(PortNumber) This doesn't work in Swift, and I'm…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
9
votes
3 answers

Specific compiler flags for specific files in Xcode

I've been tasked to work on a project that has some confusing attributes. The project is of the nature that it won't compile for the iPhone Simulator And the iPhone Device with the same compile settings. I think it has to do with needing to be…
Jasarien
  • 58,279
  • 31
  • 157
  • 188
9
votes
1 answer

What's the difference between the -symbolic and -shared GCC flags?

From the documentation's description, they seem to do the same thing except that "not all systems" support shared and "only some systems" support symbolic (it's unclear if these are the same set of systems): -shared Produce a shared object…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165