Version 5.x of GCC (GNU Compiler Collection).
Questions tagged [gcc5]
76 questions
115
votes
5 answers
How to Install gcc 5.3 with yum on CentOS 7.2?
I am using CentOS 7.2
When I use yum groupinstall "Development Tools", gcc version is 4.8.5, like this:
I would like to install gcc 5.3
How to approach this with yum?

sunshine
- 1,955
- 3
- 16
- 22
31
votes
2 answers
Valgrind Unrecognised instruction
I have the following code:
#include
#include
int main() {
std::mt19937_64 rng(std::random_device{}());
std::cout << std::uniform_int_distribution<>(0, 100)(rng) << '\n';
}
I try to profile it using valgrind, but it…

nwp
- 9,623
- 5
- 38
- 68
17
votes
2 answers
The program runs 3 times slower when compiled with g++ 5.3.1 than the same program compiled with g++ 4.8.4, the same command
Recently, I've started to use Ubuntu 16.04 with g++ 5.3.1 and checked that my program runs 3 times slower.
Before that I've used Ubuntu 14.04, g++ 4.8.4.
I built it with the same commands: CFLAGS = -std=c++11 -Wall -O3.
My program contains cycles,…

Alex Novikov
- 173
- 7
15
votes
1 answer
New option in GCC 5.3: -fno-semantic-interposition
GCC 5.3 has added a new option: -fno-semantic-interposition
A new -fno-semantic-interposition option can be used to improve code
quality of shared libraries where interposition of exported symbols is
not allowed.
This sounds like this is…

DevShark
- 8,558
- 9
- 32
- 56
12
votes
1 answer
Is my fma() broken?
In using double fma(double x, double y, double z); I'd expect a non-zero d in the output lines below marked with '?'. It appears to internally only use long double precision rather than infinite precision as specified.
The fma functions compute (x…

chux - Reinstate Monica
- 143,097
- 13
- 135
- 256
12
votes
2 answers
Is C++17 std::shared_mutex not available yet?
Looking at C++ compiler support, it appears that the untimed version of std::shared_mutex is available in GCC 5.0+. However, even with gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04), and compiling with -std=c++1z, a simple initialization…

alextoind
- 1,143
- 1
- 13
- 20
11
votes
1 answer
Output data type of sizeof() operator
I am using Ubuntu 16.04.5 and GCC version 5.4.0.
I was playing with sizeof() operator, wrote the code below:
#include
int main(int argc, char *argv[]){
long int mylint = 31331313131.1313;
printf("size of long int is…

Adhamzhon Shukurov
- 681
- 1
- 8
- 21
9
votes
3 answers
uint8_t not rollover to 0 after reaching 255 not working properly
I am new to the C-Headers - stdint.h and inttypes.h. I was trying out some code to get an inkling of how uint8_t works. But, it seems to have encountered a problem.
I have declared 4 uint8_t integers with the boundary values 0, 255, 256, -1…

TejasKhajanchee
- 103
- 2
- 8
9
votes
1 answer
How to install GCC 5.1 on Linux (Ubuntu)
I'd like to experiment with the new GCC 5.1 C++ compiler on Ubuntu.
How can I install GCC 5.1 on Ubuntu?
I'd prefer some form of pre-built executable that I could just download and install, instead of downloading GCC's sources and building the whole…

MikePro
- 192
- 1
- 2
- 6
8
votes
1 answer
Build Proxygen under Ubuntu 16.04
I would like to build Facebook's Proxygen c++ http libraries out of github with Ubuntu 16.04. Here's the environment I set up along with the deps.sh command to install dependencies:
gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0…

moodboom
- 6,225
- 2
- 41
- 45
8
votes
0 answers
Undefined reference in clang when linking to a library compiled with GCC5
I try to use the ubuntu 15.10 repository version of libmuparser (package libmuparser2v5). Compiling with gcc works fine, but not with clang. I dug deeper into this to come up with the following minimal (not) working example and a few…

John
- 1,472
- 1
- 19
- 22
8
votes
1 answer
Can't compile C++11 source using GCC 5.1 toolchain
I'm trying to compile a library written with C++11 features using GCC 5.1 on Ubuntu. However, it complains std::unique_ptr is not defined.
gcc (Ubuntu 5.1.0-0ubuntu11~14.04.1) 5.1.0
g++ (Ubuntu 5.1.0-0ubuntu11~14.04.1) 5.1.0
CXX flags:
-std=c++11…

Thijs
- 714
- 9
- 23
7
votes
1 answer
std::string class inheritance and tedious c++ overload resolution
I need to extend std::basic_string to work over path strings and different operator+:
#include
template
class path_basic_string : public std::basic_string
{
public:
…

Andry
- 2,273
- 29
- 28
7
votes
1 answer
Why does g++5 deduces object instead of initializer_list in auto type deduction
I recently came upon this code:
struct Foo{};
int main()
{
Foo a;
// clang++ deduces std::initializer_list
// g++5.1 deduces Foo
auto b{a};
a = b;
}
It compiles fine with g++5.1, but fails in clang++ (used both -std=c++11 and…

vsoftco
- 55,410
- 12
- 139
- 252
6
votes
1 answer
Invoking constructors during virtual inheritance with C++
This is a question I encountered while reading this section on learncpp.com. I used the code listed here, then made slight alterations for testing.
Background
Virtual inheritance creates a common reference to the base class, which has two…

Ryan B
- 83
- 1
- 7