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

Specific compilation flags with autotools and static library

TL;DR: When I compile an external library with a specific set of flags, how can I deal with warnings triggered by the flags used to compile my own code when I include the headers of this library ? I am using autotools as a build system in a project…
Zermingore
  • 743
  • 2
  • 11
  • 28
0
votes
1 answer

Identical Makefile nomenclature for using variable on different build commands with different results

There are three programs build by this Makefile. They follow the same pattern, but produce different build commands when run. Specifically, I require compilation with c++11 but can only achieve this on one of the build commands. Why is…
errolflynn
  • 641
  • 2
  • 11
  • 24
0
votes
1 answer

Which variable for compiler flags of CMake's ADD_LIBRARY function?

Does exist a variable which contains the compiler flags used in some call to CMake's ADD_LIBRARY function, for example the ones used when we add a module: ADD_LIBRARY(mylib MODULE mysrc.cpp) Or, is there a way of getting such flags?
Aleph
  • 1,343
  • 1
  • 12
  • 27
0
votes
1 answer

How to disable XCode compiler defines "-DXXX" in the Objective-C source code files

Tried #undef with NS_BLOCK_ASSERTIONS, but it looks like the Release default option from settings is welded brutally into the build process. The trick is to use only .m source code file directives (maybe pragmas) to disable it, because I'm in a…
vian
  • 811
  • 2
  • 12
  • 27
0
votes
2 answers

g++ -fno-enforce-eh-specs - why/how does this violate the C++ standard?

From man gcc: -fno-enforce-eh-specs Don't generate code to check for violation of exception specifications at run time. This option violates the C++ standard, but may be useful for reducing code size in production builds. When…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

Apple LLVM 8.0 optimizations flags

Apple LLVM similar to GCC has some major optimization flags: O1, O2, O3 etc. For GCC I can watch exactly command-line flags here and some of them are the same for LLVM. How to know all the flags for LLVM?
user6416335
0
votes
0 answers

How do I prevent valgrind from showing 1 less "free" than "alloc"?

valgrind prints the following diagnostic from an empty program: $cat main.cpp int main(){} $g++ -std=c++1z -o main main.cpp $valgrind --leak-check=full --show-leak-kinds=all ./main ==26823== Memcheck, a memory error…
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
0
votes
2 answers

How can I add per-file defines to a scons project

I'm in the process of porting a makefile project to scons and I can't figure out how to create a unique #define for each file. I would like to have the base filename for each file defined in order to support some custom debug macros. In the…
Mike Collins
  • 402
  • 3
  • 13
0
votes
0 answers

How to add the following flags to the Visual Studio C++ compiler?

I need to have these flags in my C/C++ compiler: -xc -std=c99 -Wall -Wextra -Werror I know how to apply them in CodeBlocks, but I'd rather use VS.
user5987748
0
votes
1 answer

Make IDE-wide configuration changes in Eclipse

I have been working on some GUI-related projects in Eclipse CDT. They always require me a specific command line pattern (Project > GCC C Linker) in order to load the libraries properly: I can't manage to keep that configuration for every project I…
xvlaze
  • 837
  • 1
  • 10
  • 30
0
votes
2 answers

Unable to suppress bound checking

Firstly, I wasn't aware that bound checking was automatic when using gfortran. With the following code: gfortran -Wno-array-bounds initial_parameters.f08 derrived_types.f08 lin_alg.f08 constitutive_models.f08 input_subs.f08 Subprograms.f08…
0
votes
0 answers

MPI_sendrecv changes loop index with -O1 flag

My code is in a stable version now and I would like to enable at least the O1 optimization level to gain speed. However, I have found a really strange behaviour with a MPI command inside a loop with -O1. In a preprocessing procedure, each MPI…
Coriolis
  • 396
  • 3
  • 10
0
votes
1 answer

In which file are compiler flags saved by xcode?

In which file are compiler flags saved by xcode? I can't find the file in which they are saved. I added a flag to multiple files without keeping a track of them. Now I am doing a diff from the previous version to find out which files got changed due…
manish
  • 301
  • 1
  • 3
  • 10
0
votes
1 answer

Using a flag for a specific folder in Grunt to build from

I would like to now if there is a way to load certain files from a certain folder when running Grunt. Let's say I have a folder structure that looks like this: [html] [css] [js] [custom] [X] x.css [Y] y.css [Z] z.css I'm trying to build…
andromedainiative
  • 4,414
  • 6
  • 22
  • 34
0
votes
1 answer

Can't make executable portable

I made a little c++ program with this library: http://libtins.github.io I compile with: g++ -o arp arp.cpp -ltins It runs fine (Ubuntu 14.04 64 bit), however if i send the executable to a friend, he gets this error when running: error while loading…
Matteo
  • 413
  • 1
  • 3
  • 9