compiler-flags Questions
2
Solved
When I compile my C++ program with g++ using the -Og option I see variables that are <optimized out>, and also the current line sometimes skips around. Is this behaviour expected at this opti...
Clerical asked 15/7, 2015 at 16:16
6
I am trying to understand why grep built by me is much slower than the one that comes with the system and trying to find what compiler options are used by grep that comes with the system.
OS Versi...
Ufo asked 23/12, 2009 at 22:22
0
This is related to an issue described in this question -- a reproducible example can be found there, as well as a description of the environment (briefly: Apple Silicon with macOS Sonoma and clang ...
Demonology asked 25/12, 2023 at 15:37
9
Solved
Is there a way to see the compiler-instantiated code for a function template or a class template in C++?
Assume I have the following piece of code:
template <class T> T add(T a, T b) {
retur...
Jetton asked 15/12, 2010 at 8:38
6
Solved
I'm compiling my C++ app using GCC 4.3. Instead of manually selecting the optimization flags I'm using -march=native, which in theory should add all optimization flags applicable to the hardware I'...
Lurlenelurline asked 29/3, 2011 at 9:14
2
Solved
To test for a feature, cppreference mentions these feature test macros:
link.
If the feature is present in the compiler, the macro is defined. But I don't understand why, if defined, they are defi...
Hitt asked 10/10, 2018 at 21:8
1
I don't find any useful information on the differences between "-fno-pie" and "-no-pie". Are they gcc flags or ld flags? Are they both necessary or not?
I found a piece of makef...
Stirk asked 3/11, 2022 at 8:42
10
Solved
I'd like to know what switch you pass to the gcc compiler to turn off unused variable warnings? I'm getting errors out of boost on windows and I do not want to touch the boost code:
C:\boost_1_52_...
Drinker asked 24/2, 2013 at 16:24
1
Solved
Description
I'm trying to switch over from using the classic intel compiler from the Intel OneAPI toolkit to the next-generation DPC/C++ compiler, but the default behaviour for handling floating po...
Parity asked 29/8, 2022 at 20:11
6
Solved
Where in Qt Creator do I pass arguments to a compiler?
It isn't really that obvious.
Psychologist asked 2/11, 2011 at 12:43
2
Clang has various sanitizers that can be turned on to catch problems at runtime.
However, there are some sanitizers that I can't use together. Why is that?
clang++-3.9 -std=c++1z -g -fsanitize=me...
Identical asked 1/5, 2016 at 21:2
1
Solved
It seems like the -malign-double compiler option has been removed from Clang. Example code:
#include <stddef.h>
#include <stdio.h>
typedef struct X { char a; long long b; } X;
int ma...
Hinman asked 22/4, 2012 at 20:12
1
Solved
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...
Scullery asked 16/4, 2020 at 17:45
2
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....
Resigned asked 23/11, 2021 at 19:43
11
Solved
I have the following content in my CMakeLists.txt:
project( Matfile )
SET ( CMAKE_CXX_FLAGS "-std=c++0x" )
set ( SOURCES
"foo.cpp"
"bar.cpp"
)
add_library(
Matfile
${SOURCES}
)
As you ma...
Afterlife asked 26/2, 2013 at 22:10
3
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 ...
Expectorant asked 2/12, 2017 at 21:56
1
Solved
What is the /d2vzeroupper MSVC compiler optimization flag doing?
I was reading through this Compiler Options Quick Reference Guide
for Epyc CPUs from AMD: https://developer.amd.com/wordpress/media/...
Murrelet asked 24/9, 2021 at 17:48
3
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++'
Detect...
Twobit asked 21/2, 2015 at 2:32
3
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 o...
Fineable asked 20/3, 2013 at 15:20
3
Solved
I'm using CMake for a project that comes in two versions, one of which requires -lglapi and the other does not.
So far the lines we used look like that:
SET(CMAKE_C_FLAGS "-O3 -xSSE3 -restrict ...
Butterfly asked 27/4, 2015 at 16:35
1
Two months ago, I reported, as a clang++ bug, that the C++ program below sets z to 4294967295 when compiled with clang++ -O2 -fno-strict-enums.
enum e { e1, e2 } e;
long long x, y, z;
char *p;
v...
Woodwind asked 7/11, 2020 at 14:40
1
Solved
clang, but NOT gcc, has a -Weverything option which appears to include things such as -Wpedantic. You can test it here: https://godbolt.org/z/qcYKd1. See the top-right of the window for where I hav...
Levitan asked 1/10, 2020 at 0:57
5
I need to make a default void method in a Kotlin interface. I ran into a problem and a hint said Usage of @JvmDefault is only allowed with -Xjvm-default option.
Where do I need to write this Xjvm-...
Gynaeco asked 28/12, 2018 at 20:54
2
Solved
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 ...
Mortonmortuary asked 21/7, 2020 at 4:58
2
Back in Xcode 9, there was a build option called "Clean Build Folder..." (⌥⇧⌘K), which deleted all files in the build folder, only leaving the folder behind with no contents. Since then, ...
Reprimand asked 22/3, 2018 at 16:57
1 Next >
© 2022 - 2024 — McMap. All rights reserved.