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
3
votes
1 answer

Centos6 gcc6: default ABI not picked up when compiling simple c++11 test file

I have a docker image for centos 6 with devtoolset-6 installed and I want to build my code with the new ABI available in gcc>=5, in this case gcc6. Somehow I do not get what I expect to work by default. I have tried various variations but I am at…
user1357687
  • 571
  • 1
  • 6
  • 9
3
votes
2 answers

gcc 6.1 std::result_of compilation error

Consider a small standalone use case wherein I want to determine if a type is a complete or incomplete using #include namespace { struct foo { template std::false_type operator()(T&); …
Recker
  • 1,915
  • 25
  • 55
3
votes
1 answer

gcc fails to inline functions without -O2

I've recently run into a problem with compiling a piece of code after upgrading debian testing, getting the gcc 6.2.1 compiler. I've boiled it down to this simple example: inline int func(void) { return 0; } int main (int argc, char **argv) { …
3
votes
1 answer

How to catch a duplicate like `-Wduplicated-cond` from GCC-6

Like the title says, for those who already know starting with GCC-6 you can catch a duplicate in an ifstatement using this Flag -Wduplicated-cond like this: #include int main(void){ int a = 5; if( a == 5){ printf("First …
Michi
  • 5,175
  • 7
  • 33
  • 58
2
votes
2 answers

Boost::Signals2 slot with lambda expression fails using gcc6 on arm32

I received the following code from a colleague, broken down to the bare minimum, using Boost::Signal2 and lambda expressions. It compiles with g++ 6.x and g++ 5.4.1 (the latter with argument -std=c++11). It should print i: 5 (should be 5) Using a…
2
votes
2 answers

Is GCC's -Wmaybe-uninitialized generating a spurious warning with -O1 for a switch statement based on an enum?

I have a piece of code of the following form: typedef enum {A=1,B} EnumType; int foo (EnumType x) { int r; switch (x) { case A: r = 1; break; case B: r = 2; break; /* default: r = -1; …
Patrick Sanan
  • 2,375
  • 1
  • 23
  • 25
2
votes
1 answer

Issues with Boost using fsanitize switch in gcc

I have been trying to take advantage of some of the GCC Instrumentation Options for runtime-checking to try and debug/diagnose issues I am having in a particular region of C++ code. To try and narrow down the problem, I started enabling some of…
ZeroDefect
  • 663
  • 1
  • 8
  • 27
2
votes
1 answer

gcc 6.2.0 is attempting to create shared object when it shouldn't?

With non relocatable assembler code linking was never a problem up until gcc 6.2.0. I don't know the exact version that stared this, but with gcc 5.4.0 (and below) this worked: $ gcc -o httpget ../obj/httpget.o ../../../lib/libribs2_ssl.a -lssl…
niry
  • 3,238
  • 22
  • 34
2
votes
1 answer

gcc - openacc - Compiled program does not function properly

Recently, there have been some efforts in GCC community to support OpenACC in their compiler. So, I wanted to try it out. Using this step-by-step tutorial (tutorial), which was close to the main documentation on GCC website, I was able to compile…
mgNobody
  • 738
  • 7
  • 23
1
vote
1 answer

make dependencies: skip vendor and package headers with gcc?

I'm starting a new project and thinking of using gcc 6.3.1 -MM to generate the dependencies into a file called Make.Dep, that I'll include from Makefile. The -M option outputs all headers, including system headers. The -MM option doesn't output…
Swiss Frank
  • 1,985
  • 15
  • 33
1
vote
3 answers

Is this valid C++ code? This doesn't work how it supposed to be

int main() { string str[5] = "ABCD"; std::cout << str[3] << std::endl; std::cout << str[0] << std::endl; return 0; } This code prints: ABCD ABCD I didn't get it, how str[3] prints ABCD? Compiler: GCC 6.3
Debu Shinobi
  • 2,057
  • 18
  • 21
1
vote
0 answers

How to suppress cc1: warning: unrecognized command line option -Wno-implicit-fallthrough

I'm running i686-w64-mingw32-gcc -Wno-implicit-fallthrough ... with gcc 6.3.0 on Linux, and I'm getting the message: cc1: warning: unrecognized command line option ‘-Wno-implicit-fallthrough’ How can I suppress this message? I do want to specify…
pts
  • 80,836
  • 20
  • 110
  • 183
1
vote
4 answers

Strange GCC6 optimization with builtin function

With GCC6 and the code snippet below, this test if (i > 31 || i < 0) { is false, and this printf is executed printf("i > 31 || i < 0 is FALSE, where i=%d", i); and produces this very weird output (GCC6): i > 31 || i < 0 is FALSE, where i=32 /*…
Bludzee
  • 2,733
  • 5
  • 38
  • 46
1
vote
0 answers

Can I link objects compiled from C++ by GCC 5.4.x and 6.x?

For some reason, I have some object files compiled with GCC 5.4.x and some object files compiled with GCC 6.x . The source code is C++14 and I'm on a x86_64 machine running GNU/Linux 4.4.x. Is it ever, at all, possible to link my objects together?…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

Type mismatch between std::complex in C++ and complex*16 in Fortran under gcc 6 with link-time optimisation

I use some scientific computing code which calls Fortran routines from C++, which has suddenly started giving a warning under gcc 6. Here is the barebones issue: Consider a Fortran subroutine mult defined in mult.f90: subroutine mult(c) complex*16…
Raziman T V
  • 480
  • 1
  • 4
  • 12