Questions tagged [gcc4.8]

Version 4.8.x of the GNU Compiler Collection. The C compiler is the de facto for Linux (though not all versions of Linux use version 4.8.x),. The compiler collection supports many other languages and platforms as well.

GCC version 4.8.x is a major release of the GNU Compiler Collection. Version 4.8.0 was released on 2013-03-22. Version 4.8.5 was released on 2015-06-23.

See also:

122 questions
7
votes
2 answers

Compile-time equivalent to std::accumulate()

I tried to code a basic, compile-time version of std::accumulate() by defining a class template that would recursively iterate through a given range and would add the elements at each iteration. When compiling a test program using gcc 4.8.4 on…
maddouri
  • 3,737
  • 5
  • 29
  • 51
7
votes
1 answer

thread_local member variable construction

I'm facing some strange behavior with thread_local and not sure whether I'm doing something wrong or it's a GCC bug. I have the following minimal repro scenario: #include using namespace std; struct bar { struct foo { foo ()…
7
votes
2 answers

GCC doesn't make use of inc

The GCC compiler $ gcc --version gcc (GCC) 4.8.2 ... doesn't generate an inc assembly instruction, where it could actually be useful, like in this C program: int main(int argc, char **argv) { int sum = 0; int i; for(i = 0; i <…
heinrich5991
  • 2,694
  • 1
  • 19
  • 26
7
votes
2 answers

GCC doesn't produce line number information even with -g option

I have built and installed GCC 4.8.1 from source: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure…
Calmarius
  • 18,570
  • 18
  • 110
  • 157
6
votes
4 answers

constexpr function not calculate value in compile time

I want to compare meta programming and use of constexpr in c++0x. then I write a fib function in both model. when I use meta programming model, answer print out very fast because it calculated in compile time. but when I use constexpr funcion it…
mostafa88
  • 532
  • 1
  • 8
  • 20
5
votes
1 answer

Why this code fails to compile with gcc 4.8.5 while it compiles fine with clang

#include using namespace std; …
user8063157
  • 285
  • 1
  • 13
5
votes
2 answers

undefined reference to '__gthrw___pthread_key_create(unsigned int*, void (*)(void*))

I'm using 64-bit gcc-4.8.2 to generate a 32-bit target, and my machine is 64-bit. I'm using c++11 concurrency features such as thread, mutex, conditiona_variables and etc. The linker gave the above error message when trying to link the executable.…
user11869
  • 1,083
  • 2
  • 14
  • 29
5
votes
4 answers

narrowing conversion from int to long unsigned int {} is ill-formed in C++11

when I run the below code - I'm getting the warning "narrowing conversion from int to long unsigned int inside {} is ill-formed in C++11 [-Wnarrowing]. I'm using GNU 4.8 compiler. typedef struct TableEntry { unsigned long value; const char…
Wild Widow
  • 2,359
  • 3
  • 22
  • 34
5
votes
3 answers

QT Creator adds -Xarch

I was using the QT Creator with an old GCC, now i updated to the 4.8 version. But the QT Creator adds a -Xarch_x86_64 option, the GCC 4.8 tells me g++: error: unrecognized command line option '-Xarch_x86_64' Is there a way to remove this options? I…
Lefsler
  • 1,738
  • 6
  • 26
  • 46
4
votes
1 answer

How should inheriting constructor behave?

This simple code produces some unexpected results. At least for me... #include class cls1 { public: cls1(){std::cout << "cls1()" << std::endl;}; cls1(int, int) : cls1() {std::cout << "cls1(int, int)" << std::endl;} }; class cls2…
4
votes
0 answers

GCC Graphite - 4.8 loops optimizations

I am working on a C++ simulation framework. In the current version, I identified two bottlenecks. The first one is Random number generating, and second one (which motivates this question) is the use of highly iterative processes (heavy for…
Gauthier Boaglio
  • 10,054
  • 5
  • 48
  • 85
4
votes
1 answer

g++ Linker errors after upgrading to gcc-4.8 on Debian, libc6

I have just dist-upgraded a Debian Weezy machine to run gcc-4.8 from gcc-4.7. Previously the build environment was sane and was compiling normally. Now it gives the following linker errors, with any program (even a trivial hello…
Riot
  • 15,723
  • 4
  • 60
  • 67
3
votes
0 answers

C++11 code, GCC [OK], VS [FAILS], ICC[??]

I am trying to build a CPP project which uses C++11 features. With GCC-4.8.3 and specifying -std=c++11 the code has no error. Visual Studio 2013 as you know doesn't fully support C++11. Instead I installed Intel Parallel Studio XE 2015 which…
mahmood
  • 23,197
  • 49
  • 147
  • 242
3
votes
0 answers

OpenMP nested tasking, 1 thread not executing tasks

I'm doing some tests with a simple code which is written below. The problem is that in a four core machine, I'm only getting 75% of load. The fourth core is idling, doing nothing. The code has an omp parallel, then an omp single inside of which the…
Raul
  • 373
  • 2
  • 7
3
votes
2 answers

Using std::hash()(std::this_thread::get_id())

I'm currently working on getting a C++ application to compile in both Windows and Linux, during some debugging I've found that std::this_thread::get_id().hash() doesn't compile on Linux with gcc 4.8 (thanks to the comments in this thread). The…
Jeremy Natale
  • 75
  • 1
  • 9
1
2
3
8 9