Questions tagged [gcc6]

Version 6.x of the GNU Compiler Collection.

Version 6.1 was released on 2016-04-27. Version 6.5. was released on 2018-10-26.

See also:

52 questions
33
votes
2 answers

Why does GCC not seem to have the filesystem standard library?

i'm facing a problem with filesystem library, it should be included in c++17 compiler, after 2 days i tried to install gcc-7.0.2 in raspberry pi but it didn't work, it couldn't recognize the command gcc-7 or g++-7 or even -std=c++17 so i had to…
shadow
  • 767
  • 3
  • 8
  • 20
14
votes
3 answers

How to tell gcc to disable padding inside struct?

I’m unsure on whether it’s normal or it’s a compiler bug but I have a C struct with lot of members. Among of them, there’s, : struct list { ... ... const unsigned char nop=0x90; // 27 bytes since the begining of the structure const…
user2284570
  • 2,891
  • 3
  • 26
  • 74
13
votes
1 answer

Global scope resolution in the presence of using namespace

Consider the following code: namespace foo { namespace bar { class foo {}; } class baz {}; } using namespace foo::bar; ::foo::baz mybaz; Is this code valid? Or is ::foo ambiguous? Or does ::foo refer to the class foo, such that there is…
Zulan
  • 21,896
  • 6
  • 49
  • 109
11
votes
1 answer

Why does GCC 6 assume data is 16-byte aligned?

(Sorry in advance for not having managed to reduce my problem to a simple failing test case...) I have faced issues with upgrading to GCC 6.3.0 to build our codebase (relevant flags: -O3 -m32). Specifically, my application segfaults within a struct…
Julien Vivenot
  • 2,230
  • 13
  • 17
10
votes
0 answers

Is there, or will there be, a "global" version of the target_clones attribute?

I've recently played around with the target_clones attribute available from gcc 6.1 and onward. It's quite nifty, but, for now, it requires a somewhat clumsy approach; every function that one wants multi-versioned has to have an attribute declared…
bolind
  • 512
  • 3
  • 15
9
votes
1 answer

Valgrind reporting Mismatched free() / delete / delete []

I'm writing a library that will operate on multiple systems (some of which do not have malloc or a stdlib). In my stdlib (different lib), I am overriding the new and delete operators to make generic calls to functions (this example doesn't have…
Chris Smith
  • 2,928
  • 4
  • 27
  • 59
9
votes
1 answer

why is std::equal much slower than a hand rolled loop for two small std::array?

I was profiling a small piece of code that is part of a larger simulation, and to my surprise, the STL function equal (std::equal) is much slower than a simple for-loop, comparing the two arrays element by element. I wrote a small test case, which…
KBentley57
  • 146
  • 6
8
votes
1 answer

Implementation of std::unique_ptr::reset in gcc 6

Since GCC 6 in C++ the declaration/definition of a unique_ptr::reset method (not the one, that accepts only nullptr_t) looks like this: template , …
7
votes
3 answers

Does gcc 6 support the use of std::sample (c++17)?

I'm trying to compile this piece of c++ 17 code that contains std::sample using gcc version 6.3.0 with the following command: g++ -std=gnu++17 -c main.cpp. But I get this: error: ‘sample’ is not a member of ‘std’... #include #include…
T.L
  • 595
  • 3
  • 16
6
votes
3 answers

Array of concept pointers

I am trying to figure out if I can use concepts as a kind of interface for classes without requiring the overhead of a virtual table. I put together an example which sort-of works, but I have to store my class instances in an array defined by their…
Moe42
  • 63
  • 3
5
votes
1 answer

GCC Bug - In/Decrement array access in constexpr

I found a bug in GCC 6 and 7 (not in GCC 5) inside constexpr functions, which leads to different results if either the function gets evaluates at compile time (wrong result) or runtime (correct result). #include constexpr int bar(int *b)…
Viatorus
  • 1,804
  • 1
  • 18
  • 41
4
votes
1 answer

g++: optimization -march=haswell and newer changes numerical result

I have been working on optimizing performance and of course doing regression tests when I noticed that g++ seems to alter results depending on chosen optimization. So far I thought that -O2 -march=[whatever] should yield the exact same results for…
laolux
  • 1,445
  • 1
  • 17
  • 28
4
votes
1 answer

Using CUDA 8.0 with GCC 6.x - bad function overloading complaint

I'm trying to build some CUDA code using GCC 6.2.1, the default compiler of my distribution (Note: not a GCC version officially supported by CUDA, so you can call this experimental). This is code which builds fine with GCC 4.9.3 and both CUDA…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
4
votes
0 answers

GCC 6.1 explicit template instantiation gives undefined symbol for default constructor

Put this in a file called t.hpp: #include extern template class std::unordered_map; std::unordered_map getMap(); And this in t.cpp: #include "t.hpp" std::unordered_map getMap() { return…
John Zwinck
  • 239,568
  • 38
  • 324
  • 436
4
votes
0 answers

Is -fsanitize=bounds-strict included in -fsanitize=undefined for GCC 6?

I'm working on a problem report for a C++ library compiled with GCC 6. I'm reading through the GCC 6 Changes, New Features, and Fixes, and one of the notes is: UndefinedBehaviorSanitizer gained a new sanitization option, -fsanitize=bounds-strict,…
jww
  • 97,681
  • 90
  • 411
  • 885
1
2 3 4