Questions tagged [gcc7]

GCC 7 is a major release of the GNU Compiler collection first released in 2017.

Version 7.1. was released on 2017-05-02. Version 7.5 was released on 2019-11-14.

See also:

74 questions
35
votes
4 answers

Handling gcc's noexcept-type warning

Consider this example, from bug 80985: template void call(Func f) { f(); } void func() noexcept { } int main() { call(func); } Compiling this with all warnings enabled, as you do, yields: $ g++ -std=c++14 -Wall foo.cxx…
Barry
  • 286,269
  • 29
  • 621
  • 977
27
votes
2 answers

Safety of std::unordered_map::merge()

While writing some code targeting C++17, I kind of hit a stumbling block determining the exception-safety of an operation merging two compatible std::unordered_maps. Per the current working draft, §26.2.7, table 91 reads, in part, regarding the…
Capital C
  • 271
  • 2
  • 5
21
votes
5 answers

c++1z dynamic exception specification error

I am trying to compile my project with new GCC version 7.2.1 and have a problem with dynamic exception specifications: error: ISO C++1z does not allow dynamic exception specifications MEMORY_ALLOC_OPERATORS(SQLException) The problem is that these…
Pustovalov Dmitry
  • 998
  • 1
  • 9
  • 25
21
votes
2 answers

Why does including break structured bindings in GCC?

Consider: struct Point { int x, y; }; int main() { const auto [x, y] = Point{}; } This code compiles fine with gcc 7.1 in C++17 mode, however this one: #include struct Point { int x, y; }; int main() { const auto [x, y] =…
robson3.14
  • 3,028
  • 2
  • 20
  • 19
15
votes
1 answer

LeakSanitizer not working under gdb in Ubuntu 18.04?

I've upgraded my Linux development VM from Ubuntu 16.04 to 18.04 recently, and noticed one thing that has changed. This is on x86-64. With 16.04, I've always had this workflow where I'd build the project I'm working on with gcc (5.4, the stock…
fencekicker
  • 732
  • 1
  • 8
  • 18
14
votes
2 answers

gcc 7.1.1 on Fedora 26 dumpversion now only includes major version by default

After upgrading from Fedora 25 to 26 the default gcc version is now version 7.1.1 and the output of gcc -dumpversion has changed from major.minor.patch to just major. new output: $ gcc -dumpversion 7 The manual states -dumpversion Print the…
Jake1164
  • 12,291
  • 6
  • 47
  • 64
10
votes
4 answers

gcc-7: error: unrecognized command line option ‘-m64’

I'm trying to compile C code on a Jetson Nano and I get this error during compiling. I tried removing any occurrence of 'm -64' but it seems like its added automatically. This is the cmd where it fails: /usr/bin/gcc-7 -Wall -Wextra -Wconversion…
Jen
  • 121
  • 1
  • 1
  • 7
7
votes
1 answer

conda install -c anaconda gcc_linux-64 not being used

I wanted to install updated version of gcc on a server where I do not have root access. I tried conda install -c creditx gcc-7 which was not working. Then I found conda install -c anaconda gcc_linux-64 in fact installs gccv7.3. But after the…
deltasata
  • 377
  • 1
  • 4
  • 21
6
votes
1 answer

is_lock_free() returned false after upgrading to MacPorts gcc 7.3

Previously, with Apple LLVM 9.1.0, is_lock_free() on 128-bit structures have returned true. To have complete std::optional support, I then upgraded to MacPorts gcc 7.3. During my first try to compile, I encountered this notorious showstopper linker…
Lingxi
  • 14,579
  • 2
  • 37
  • 93
5
votes
2 answers

CPU spatial cache locality in array iteration

My understanding of the L1 cache was that a memory fetch loads a cache line. Assuming the cache line size is 64 bytes, if I access memory at address p, it will load the entire block from p to p + 64 into the cache. Thus, it is best to iterate…
user1413793
  • 9,057
  • 7
  • 30
  • 42
5
votes
3 answers

gcc7.2: argument range exceeds maximum object size 9..7 [-Werror=alloc-size-larger-than=]

The program contains code like follows: int size; ... int *pi = (int*)calloc(size, sizeof(int)); ... Here is the error message when compiled with gcc7.2: error: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object…
Yuan Wen
  • 1,583
  • 3
  • 20
  • 38
5
votes
2 answers

GCC 7, aligned_storage and "dereferencing type-punned pointer will break strict-aliasing rules"

A code that I wrote was warning-free in GCC 4.9, GCC 5 and GCC 6. It was also warning-free with some older GCC 7 experimental snapshots (for example 7-20170409). But in the most recent snapshot (including the first RC), it started to produce a…
Freddie Chopin
  • 8,440
  • 2
  • 28
  • 58
4
votes
2 answers

GCC 7 C++ 17 support for folding expressions

The following snippet will compile in GCC 8+, but fails to compile in GCC 7. template struct A { explicit A(THINGS *... things) { (..., [thing = things](){}()); } }; int main() { int thing; const auto thingy…
Taekahn
  • 1,592
  • 1
  • 13
  • 16
4
votes
1 answer

flto crash with gcc7.2

I have a crash with getline in the following code file. I built gcc7.2 because system updates are not available. Minimal example : #include int main(int argc, char *argv[]) { std::string line; while (std::getline(std::cin,…
phi
  • 71
  • 7
4
votes
0 answers

Cross compiling gcc 7.2 from x86_64 to aarch64

I have successfully compiled gcc 7.2 from source on an x86_64. Native to native, so the resulting compiler is an x86_64 binary which works fine. I would also like to have a working compiler for aarch64 (so, not a cross compiler. An aarch64 compiler…
bolind
  • 512
  • 3
  • 15
1
2 3 4 5