Questions tagged [gcc4]

Version 4.x of GCC (GNU Compiler Collection). It's the de facto standard C compiler on Linux and supports many other languages and platforms as well.

Version 4.0.0 was released on 2005-04-20. Version 4.9.4 was released on 2016-08-03.

See also:

184 questions
1
vote
3 answers

Does optimization change the behavior of casts?

I'm working with a small UART device and frequently need to switch the baud rate at which it operates. Essentially the whole set-up boils down to #define FOSC 2000000 #define BAUD 9600 uint8_t rate = (uint8_t) ((FOSC / (16.0 * BAUD)) - 1 +…
Etheryte
  • 24,589
  • 11
  • 71
  • 116
1
vote
0 answers

Undefined reference to `__atomic_load_16' for atomic shared_ptr

I get linking error like $ g++ -o yyy atomic.cpp --std=c++11 /tmp/ccLVp09P.o: In function `std::atomic >::load(std::memory_order)…
triclosan
  • 5,578
  • 6
  • 26
  • 50
1
vote
1 answer

gcc4.7 error - dereferencing type-punned pointer

I have a third-party piece of code to compile, below is the snippet that fails: typedef struct wqe_s { ... uint8_t packet_data[96] ... } wqe_t; .. wqe_t *work = NULL; .. wqe_t *w1 = *(wqe_t **)work->packet_data; // ERROR error:…
Mark
  • 6,052
  • 8
  • 61
  • 129
1
vote
1 answer

How to access local variables in GCC inline assembly while changing sp?

Consider the following simplified example function: void foo(void) { int t; asm("push %0\n\t" "push %0\n\t" "call bar" : : "m" (t) : ); } If I compile it with Cygwin x86 gcc 4.8.3 without…
dreamlayers
  • 173
  • 1
  • 6
1
vote
1 answer

How to convince avr-gcc, that the memory position of a global byte array is a constant

I writing a fast "8 bit reverse"-routine for an avr-project with an ATmega2560 processor. I'm using GNU C (WinAVR 20100110) version 4.3.3 (avr) / compiled by GNU C version 3.4.5 (mingw-vista special r3), GMP version 4.2.3, MPFR version…
Thomas
  • 595
  • 6
  • 15
1
vote
1 answer

Error while compiling a C++ application on a raspberry pi

I would like to ask where does this error come from: c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See for…
E-Kami
  • 2,529
  • 5
  • 30
  • 50
1
vote
1 answer

GDB sets multiple breakpoints when I am unambiguously setting a breakpoint for a line number. Bad debug symbols?

I get this strange behaviour when setting a breakpoint: GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1) ... Blah blah legal stuff Reading symbols from /home/matt/Programming/Latium/latium/src/test_latium...done. (gdb) break base58.h:144 Breakpoint 1 at…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
1
vote
0 answers

Cannot install command line tools due to out of date xcode-select

For weeks I've been trying to work this out. When I run bash install_script.sh file as yt-project ( http://yt-project.org/#getyt ) instructs, it outputs this error: gcc -fPIC -c blocksort.c make: gcc: No such file or directory make: ***…
1
vote
0 answers

QT 4.8.5 compile error in CentOS 5.X

I have download the Qt-everywhere-4.8.5.tar.gz from Qt official website. And In the CentOS 5.X, it's GCC version is 4.1.2. So I have compiled the gcc-4.7.2 from source code and installed it in $HOME/software/, then in the install directory, there…
mining
  • 3,557
  • 5
  • 39
  • 66
1
vote
2 answers

Error linking with gcc

I've try to compile this code: #include #include using namespace std; #define ARRAY_TAM 2 typedef int (*operacion)(int, int); typedef const char* (*Pfchar)(); int suma(int, int); int resta(int, int); const char*…
Facon
  • 679
  • 2
  • 7
  • 21
1
vote
1 answer

What is --without-x option for?

I have a gcc compiler v 4.2.2 with next build options : $ /opt/eldk-4.2/usr/bin/ppc_6xx-gcc -v Reading specs from /home/dejovivl/workspace/eldk-4.2/usr/bin/../lib/gcc/powerpc-linux/4.2.2/specs Target: powerpc-linux Configured with:…
BЈовић
  • 62,405
  • 41
  • 173
  • 273
1
vote
2 answers

g++ -- missing array header

The following simple code can't be compiled by g++ 4.3: #include using namespace std; int main() { std::array myarray; return 0; } array: No such file or directory Also, the compiler doesn't seen to understand option…
Mark
  • 6,052
  • 8
  • 61
  • 129
1
vote
1 answer

two or more data types in declaration specifiers error in header file

I am an OS developer and I would like to compile the following (it's in the file cpu.h) with my gcc crosscompiler(ver= 4.5.4) #ifndef X86_64_CPU_H #define X86_64_CPU_H #include typedef struct { // manually secured registers …
Martin Erhardt
  • 581
  • 11
  • 23
1
vote
2 answers

why do I need copy constructor here

I have a helper class for freeing MYSQL_RES handles. class auto_mysqlres { public: auto_mysqlres(MYSQL_RES *res) : m_res(res) { } ~auto_mysqlres() { if (m_res != NULL) mysql_free_result(m_res); } operator MYSQL_RES* () { …
Sergi0
  • 1,084
  • 14
  • 28
1
vote
1 answer

Error while building linux kernel 3.8.11 - unrecognized command line option "-fstack-protector"

I'm trying to build the 3.8.11 kernel for arm architecture and I use the tool chain provided by the vendor of my eval board for arm sbc (technologic systems). I see this issue while compiling the default vanilla kernel 3.8.11 with my arm tool…
devgp
  • 1,321
  • 3
  • 17
  • 36