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

gcc compiler not stop on first error

How does one get gcc to not stop compiling after the first error. Is there a compiler flag that will do this? Basically I'm wanting to remove a class, but i'm not sure how much of an impact that will have, so i'm wanting to determine how many…
shadonar
  • 1,114
  • 3
  • 16
  • 40
18
votes
1 answer

UseConcMarkSweepGC is deprecated, what is its replacement?

A java program is giving this warning, with JRE 10.0.2: Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. What is the recommended replacement for this…
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54
18
votes
3 answers

How to tell which specific compiler will be invoked for a Python C extension: GCC or Clang?

I have a Python C++ extension that requires the following compilation flags when compiled using Clang on OS X: CPPFLAGS='-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8' LDFLAGS='-lc++' Detecting OS X in my setup.py is easy enough. I can do…
syllogism_
  • 4,127
  • 29
  • 22
18
votes
1 answer

How to force xcode to use ARC on a specific file?

My project contains XMPPFramework which contains a file that has to be used with ARC. But my project is Non ARC and cannot be converted due to certain other libraries linked to it. How do I force the compiler to use ARC only on a certain class ?
Maduranga E
  • 1,679
  • 5
  • 23
  • 37
16
votes
1 answer

Passing `-std=c++11` to CMakeLists?

I have just installed Qt Creator and am using C++11 syntax. Unfortunately when I try to build my project I get: /usr/include/c++/4.8/bits/c++0x_warning.h:32: error: #error This file requires compiler and library support for the ISO C++ 2011 …
A T
  • 13,008
  • 21
  • 97
  • 158
15
votes
4 answers

Why is /Wp64 deprecated?

Why is the /Wp64 flag in Visual C++ deprecated? cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
user541686
  • 205,094
  • 128
  • 528
  • 886
15
votes
1 answer

What happens when code that throws exceptions is linked against a library compiled with -fno-exceptions?

Specifically I'd like to know what, if any, guarantees are made by GCC about how code that throws exceptions behaves when linked against code compiled using -fno-exceptions. The GNU libstdc++ manual says the following here. Before detailing the…
Sam Marinelli
  • 999
  • 1
  • 6
  • 16
14
votes
1 answer

How to print current compilation flags that are set with target_compile_options()?

I am trying to print compilation flags that are set for target. The best scenario is to print a line with current flags on configure and compilation times, but if it's impossible, then on configure time only (or compilation only) (acceptable…
stackoverflower
  • 545
  • 1
  • 5
  • 21
14
votes
2 answers

Should one specify a type signature for main or not? Why / why not?

I learned from chapter 9 of Learn You A Haskell For Great Good that By convention, we don't usually specify a type declaration for main. As far as I can tell, this convention is widespread. However, if I compile, using the -Wall flag, a program…
jub0bs
  • 60,866
  • 25
  • 183
  • 186
14
votes
2 answers

Should I use "-ansi" or explicit "-std=..." as compiler flags?

I've read that ANSI C is not exactly the same as ISO C and compilers may differ in interpretation of what "-ansi" is about. (gcc maps it to C90, clang maps it to C89) At the moment I would tend to use "-std=..." over "-ansi" as then it is explicitly…
math
  • 8,514
  • 10
  • 53
  • 61
13
votes
3 answers

How do I specify different compiler flags for just one Python/C extension source file?

I have a Python extension which uses CPU-specific features, if available. This is done through a run-time check. If the hardware supports the POPCNT instruction then it selects one implementation of my inner loop, if SSSE3 is available then it…
Andrew Dalke
  • 14,889
  • 4
  • 39
  • 54
12
votes
2 answers

How do I upgrade to C++17?

I am using Atom as my IDE, my current __cplusplus = 201402 which is C++14 and my compiler is g++ (GCC) 9.2.0. How do I upgrade to C++17 or C++20? Everything I've searched up involves using another IDE (Microsoft Visual Studio).
yellowgrass
  • 121
  • 1
  • 1
  • 7
12
votes
4 answers

Set Java compiler compliance level

I need to compile a Java program on the command line, and I am trying to set the compiler level to a lower one (1.6). I tried like this but it didn't work: javac -1.6 Hello.java
georgiana_e
  • 1,809
  • 10
  • 35
  • 54
12
votes
1 answer

Where can I find more information about D_GLIBCXX_DEBUG and DNDEBUG flags?

I am trying to understand D_GLIBCXX_DEBUG and DNDEBUG flags. But I can't find information about them. Can anyone explain what they do? and where can I read more about them?
Pratik Deoghare
  • 35,497
  • 30
  • 100
  • 146
12
votes
2 answers

How much should I optimize?

In regards to optimizations done by the compiler (GCC), what is the standard practice? What does each option (-O, -O1, -O2, -O3, -Os, -s, -fexpensive-optimizations) do differently, and how do I decide what is optimal?
user768417
1 2
3
31 32