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
1
vote
0 answers

How does the optimization option in GCC 7.5.0 change the address order of the global variables?

When I was reading the 7th chapter of CSAPP, I came across a problem that I still can't solve till now. foo.c #include void f(void); int y = 15212; int x = 15213; int main(void) { f(); printf("x = 0x%x y = 0x%x\n", x, y); …
1
vote
1 answer

Is there a bug in GCC 7.3.0 link thread library use -static?

I use std::call_once in my code, it compiled succeed but crashed when runing... like this demo: #include #include using namespace std; int main() { cout << "Hello world" << endl; static once_flag of; …
luyuan
  • 71
  • 1
  • 3
1
vote
1 answer

Weird std::atof bug with gcc 7.4.0

I've got this weird behavior with std::atof in Ubuntu 18.0.4 with Qt Creator(4.10) as IDE / gcc 7.4.0 : It parses strings as normal when i run in debug mode from QtCreator. But it floors when i run normally. Example code with this…
hsyntsy
  • 21
  • 4
1
vote
1 answer

Lambda capture, initializers and nested struct

Could someone explain what is happening here (GCC 7.3): #include #include struct A { struct B {}; }; int main() { int var = 0; std::thread([c=A::B(), var](){ }); // error: ‘var’ was not declared in this scope …
lstipakov
  • 3,138
  • 5
  • 31
  • 46
1
vote
0 answers

I cannot link with gcc-7

I have 3 files: tester.c, knnring_sequential.c, knnring.h. I compile them with the sequence: gcc-7 -c knnring_sequential.c -o knnring_sequential.o ar rcs knnring_sequential.a knnring_sequential.o gcc-7 -o tester tester.c knnring_sequential.a When I…
sted
  • 83
  • 9
1
vote
0 answers

Found some old code using __single_client_alloc - how can I revive it?

I found an old package online that I'd like to use. One of the header files includes the following lines: #include "gcc_version.h" #if GCC_VERSION>=3002 #define malloc_alloc __single_client_alloc #include #include…
Heshy
  • 382
  • 1
  • 10
1
vote
1 answer

Same AVX2 program yields different result in gcc & msvc

I'm trying to increase throughput of md5 hash using AVX2. I have used simd_md5 library provided by a github user.. On msvc2013 i get desired result for all 8 buffers but on linux when i run the same code only for first 4 buffers the result match &…
Nathan S
  • 13
  • 3
1
vote
0 answers

CMake Project "undefined reference" error with GCC7, but not GCC4.8

We are having a strange problem when linking a shared library (Foo) with another internal static library (Bar). Bot libraries are built on the same machine within the same CMake build directory. It is clear that code in shared libraries must be…
gordonk
  • 435
  • 3
  • 13
1
vote
0 answers

Unable to build C++ binary with -fvtable-verify

I am trying to enable vtable verification in my project. When I try to use the flag (-fvtable-verify=std) I get an error g++: error: -fvtable-verify=std is not supported in this configuration. Can you help me figure out what is going…
user1918858
  • 1,202
  • 1
  • 20
  • 29
1
vote
1 answer

having problems making and installing gcc

I am having trouble installing gcc. Given the information below, what am I doing wrong? From $HOME/gcc on a Linux computer that I do not have root access to, I run the following: $ wget…
Clay
  • 2,584
  • 1
  • 28
  • 63
1
vote
0 answers

It is possible turn On the GCC flag "-Waggressive-loop-optimizations" with or without "-O0" optimizations level?

Like the title suggest I am wondering if there is a way to turn on the GCC flag -Waggressive-loop-optimizations when the optimizations level is -O0 or without using -OX at all. Lets see the following example: #include int main ( void…
Michi
  • 5,175
  • 7
  • 33
  • 58
1
vote
1 answer

Error when building FIX 8

Using gcc 7.1 [idf fix8]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap…
Ivan
  • 7,448
  • 14
  • 69
  • 134
1
vote
0 answers

Some template functions no longer compile in gcc 7

After upgrading from gcc 6.1 to to 7.1, some of my code no longer compiles: include\jw\vector2.h: In member function 'constexpr jw::vector2& jw::vector2::operator=(const jw::vector2&)': include\jw\vector2.h(32,119): error : expected…
user5434231
  • 579
  • 3
  • 16
0
votes
0 answers

How to resolve 'error while loading shared libraries: libgfortran.so.4

I was getting this error: error while loading shared libraries: libgfortran.so.4: cannot open shared object file: No such file or directory To resolve this, I searched "libgfortran.so.4" on google and I come to this site " How to install…
0
votes
1 answer

Do ubuntu, gcc later version cover older versions?

My professor is using automated scoring program for my programming assignment. It is C programming handling some file stuff. He asks students to use Ubuntu version 18.xx and gcc 7.xx. and I asked him if I can use the later version of those, which…
hoo
  • 67
  • 4