Search Results

Search found 2220 results on 89 pages for 'gcc'.

Page 2/89 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why doesn't GCC produce a warning when assigning a signed literal to an unsigned type?

    - by maerics
    Several questions on this website reveal pitfalls when mixing signed and unsigned types and most compilers seem to do a good job about generating warnings of this type. However, GCC doesn't seem to care when assigning a signed constant to an unsigned type! Consider the following program: /* foo.c */ #include <stdio.h> int main(void) { unsigned int x=20, y=-30; if (x > y) { printf("%d > %d\n", x, y); } else { printf("%d <= %d\n", x, y); } return 0; } Compilation with GCC 4.2.1 as below produces no output on the console: gcc -Werror -Wall -Wextra -pedantic foo.c -o foo The resulting executable generates the following output: $ ./foo 20 <= -30 Is there some reason that GCC doesn't generate any warning or error message when assigning the signed value -30 to the unsigned integer variable y?

    Read the article

  • How do I install gcc 4.8.1 on Ubuntu 13.04?

    - by sud_the_devil
    I have a 64 bit UBUNTU 13.04 running gcc --version shows me gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 But on May 31 2013 gcc 4.8.1 was released . And I don't know how to install it .. Can someone please explain me the steps that I need to do for successfull installation .. Also please tell me whether I can have both the instances of gcc installed i.e 4.7.3 & 4.8. 1 or not ?? And after installation how can I point to the new gcc 4.8.1 ??

    Read the article

  • gcc compiling error on Solaris 10

    - by osman toker
    I want to compile a source code, but there are some compiling errors about __sync_xxx functions (__sync_bool_compare_and_swap etc.) GCC version on machine is 3.4.3 (it must be gcc 4.1 or over for supporting atomic builtins), so I have downloaded GCC v4.6, copied it to another directory (I didn't remove v3.4.3) then change the $PATH path for GCC but it doesn't work (the same error occurs). I want to ask that is only changing gcc path with export PATH=... enough for compiling with new GCC?

    Read the article

  • how to tune libstdc++ to the native architecture when building gcc

    - by John D
    I recently found that when I build my C++ software, I get about a 10% speedup by using the g++ march=native option. When compiling gcc and libstc++, is it possible to tune the libstdc++ library to the native architecture as well? I couldn't find any mention of this in the gcc install configuration documentation. (I'm building gcc 4.6.2 on Linux Mint 11 with an Intel Core i7 Sandy Bridge-E processor.)

    Read the article

  • not able to use g++ from Fedora

    - by eSKay
    $ yum list | grep gcc arm-gp2x-linux-gcc.i686 4.1.2-11.fc12 @fedora arm-gp2x-linux-gcc-c++.i686 4.1.2-11.fc12 @fedora gcc.i686 4.4.3-4.fc12 @updates libgcc.i686 4.4.3-4.fc12 @updates avr-gcc.i686 4.4.2-2.fc12 updates avr-gcc-c++.i686 4.4.2-2.fc12 updates compat-gcc-34.i686 3.4.6-18 fedora compat-gcc-34-c++.i686 3.4.6-18 fedora compat-gcc-34-g77.i686 3.4.6-18 fedora compat-libgcc-296.i686 2.96-143 fedora gcc-c++.i686 4.4.3-4.fc12 updates gcc-gfortran.i686 4.4.3-4.fc12 updates gcc-gnat.i686 4.4.3-4.fc12 updates gcc-java.i686 4.4.3-4.fc12 updates gcc-objc.i686 4.4.3-4.fc12 updates gcc-objc++.i686 4.4.3-4.fc12 updates mingw32-gcc.i686 4.4.1-3.fc12 fedora mingw32-gcc-c++.i686 4.4.1-3.fc12 fedora mingw32-gcc-gfortran.i686 4.4.1-3.fc12 fedora mingw32-gcc-objc.i686 4.4.1-3.fc12 fedora mingw32-gcc-objc++.i686 4.4.1-3.fc12 fedora msp430-gcc.i686 3.2.3-3.20090210cvs.fc12 $ gcc works fine on .c files but fails on .cpp files saying: $ gcc: error trying to exec 'cc1plus': execvp: No such file or directory g++ fails saying: $ g++: Command not found. What should I do to be able to compile C++ files?

    Read the article

  • Does using GCC specific builtins qualify as incorporation within a project?

    - by DavidJFelix
    I understand that linking to a program licensed under the GPL requires that you release the source of your program under the GPL as well, while the LGPL does not require this. The terminology of the (L)GPL is very clear about this. #include "gpl_program.h" means you'd have to license GPL, because you're linking to GPL licensed code. And #include "lgpl_program.h" means you're free to license however you want, so that it doesn't explicitly prohibit linking to LGPL source. Now, my question about what isn't clear is: [begin question] GCC is GPL licensed, compiling with GCC, does not constitute "integration" into your program, as the GPL puts it; does using builtin functions (which are specific to GCC) constitute "incorporation" even though you haven't explicitly linked to this GPL licensed code? My intuition tells me that this isn't the intention, but legality isn't always intuitive. I'm not actually worried, but I'm curious if this could be considered the case. [end question] [begin aside] The reason for my equivocation is that GCC builtins like __builtin_clzl() or __builtin_expect() are an API technically and could be implemented in another way. For example, many builtins were replicated by LLVM and the argument could be made that it's not implementation specific to GCC. However, many builtins have no parallel and when compiled will link GPL licensed code in GCC and will not compile on other compilers. If you make the argument here that the API could be replicated by another compiler, couldn't you make that identical claim about any program you link to, so long as you don't distribute that source? I understand that I'm being a legal snake about this, but it strikes me as odd that the GPL isn't more specific. I don't see this as a reasonable ploy for proprietary software creators to bypass the GPL, as they'd have to bundle the GPL software to make it work, removing their plausible deniability. However, isn't it possible that if builtins don't constitute linking, then open source proponents who oppose the GPL could simply write a BSD/MIT/Apache/Apple licensed product that links to a GPL'd program and claim that they intend to write a non-GPL interface that is identical to the GPL one, preserving their BSD license until it's actually compiled? [end aside] Sorry for the aside, I didn't think many people would follow why I care about this if I'm not facing any legal trouble or implications. Don't worry too much about the hypotheticals there, I'm just extrapolating what either answer to my actual question could imply.

    Read the article

  • Does Ubuntu ever push new versions of GCC into the package repository between releases?

    - by Lex Fridman
    Current version of GCC in Ubuntu 11.04 is 4.5.2. For certain C++0x features, I need GCC version 4.6, but would like to avoid compiling from source. Is there hope that Ubuntu will update GCC in the package repository before the next release in October (11.10). This question asks a similar thing except for an earlier version of Ubuntu and GCC. A second part of the question, if the answer is "no" to the first, then can I hope to see it appear in Ubuntu's unstable repository?

    Read the article

  • how to downgrage gcc to version 4.1.1 if I use 64-bit Ubuntu 11.10 or 12.04?

    - by SSolid
    how to downgrade gcc to version 4.1.1 if i am using 64-bit ubuntu 11.10 or 12.04? please notice that I'm using 64-bit version of ubuntu It may seems simlar to this question Old version of gcc for new Ubuntu but I can't solve it with the method provide in that thread I get some error like gcc-4.1 : Depends: cpp-4.1 (= 4.1.2-27ubuntu1) but it is not going to be installed can someone tell me how to do it? thanks

    Read the article

  • gcc built by crosstool-ng gives undefined reference

    - by netvope
    I've successfully built a toolchain using crosstool-ng with the default configuration named x86_64-unknown-linux-gnu. The documentation says: Using the toolchain is as simple as adding the toolchain's bin directory in your PATH, such as: export PATH="${PATH}:/your/toolchain/path/bin" and then using the target tuple to tell the build systems to use your toolchain: ./configure --target=your-target-tuple or make CC=your-target-tuple-gcc or make CROSS_COMPILE=your-target-tuple- and so on... I followed the instructions and attempted to build GNU tar (tar-1.25.tar.bz2) with the toolchain. The commands ./configure --target=x86_64-unknown-linux-gnu and make CROSS_COMPILE=x86_64-unknown-linux-gnu- do not work (the build will succeed, but it uses the host system's gcc). The command make CC=x86_64-unknown-linux-gnu-gcc works, but in the very last step when it tries to link, it returns errors like this: compare.o: In function `openat': /dev/shm/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root/usr/include/bits/fcntl2.h:134: undefined reference to `__openat_2' What could be the problem? Was the toolchain not properly setup? Perhaps x86_64-unknown-linux-gnu-gcc is using the header files from the host system but could not find the libraries in the target's sys-root?

    Read the article

  • More GCC link time issues: undefined reference to main

    - by vikramtheone
    Hi Guys, I'm writing software for a Cortex-A8 processor and I have to write some ARM assembly code to access specific registers. I'm making use of the gnu compilers and related tool chains, these tools are installed on the processor board(Freescale i.MX515) with Ubuntu. I make a connection to it from my host PC(Windows) using WinSCP and the PuTTY terminal. As usual I started with a simple C project having main.c and functions.s. I compile the main.c using GCC, assemble the functions.s using as and link the generated object files using once again GCC, but I get strange errors during this process. An important finding - Meanwhile, I found out that my assembly code may have some issues because when I individually assemble it using the command as -o functions.o functions.s and try running the generated functions.o using ./functions.o command, the bash shell is failing to recognize this file as an executable(on pressing tab functions.o is not getting selected/PuTTY is not highlighting the file). Can anyone suggest whats happening here? Are there any specific options I have to send, to GCC during the linking process? The errors I see are strange and beyond my understanding, I don't understand to what the GCC is referring. I'm pasting here the contents of main.c, functions.s, the Makefile and the list of errors. Help, please!!! Vikram main.c #include <stdio.h> #include <stdlib.h> int main(void) { puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; } functions.s * Main program */ .equ STACK_TOP, 0x20000800 .text .global _start .syntax unified _start: .word STACK_TOP, start .type start, function start: movs r0, #10 movs r1, #0 .end Makefile all: hello hello: main.o functions.o gcc -o main.o functions.o main.o: main.c gcc -c -mcpu=cortex-a8 main.c functions.o: functions.s as -mcpu=cortex-a8 -o functions.o functions.s Errors ubuntu@ubuntu-desktop:~/Documents/Project/Others/helloworld$ make gcc -c -mcpu=cortex-a8 main.c as -mcpu=cortex-a8 -o functions.o functions.s gcc -o main.o functions.o functions.o: In function `_start': (.text+0x0): multiple definition of `_start' /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../crt1.o:init.c:(.text+0x0): first defined here /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../crt1.o: In function `_start': init.c:(.text+0x30): undefined reference to `main' collect2: ld returned 1 exit status make: *** [hello] Error 1

    Read the article

  • compile software with older version of gcc and linux kernel

    - by ant2009
    Distributor ID: SUSE LINUX Description: openSUSE 11.4 (x86_64) Release: 11.4 Codename: Celadon gcc (SUSE Linux) 4.5.1 Linux linux-14ay 2.6.37.6-0.20-desktop #1 SMP PREEMPT 2011-12-19 23:39:38 +0100 x86_64 x86_64 x86_64 GNU/Linux Hello, I am trying to install software on the above system. However, the software that I need requires an earlier version of gcc (version 4.1) my current install version is 4.5.1. It is possible to install an 4.1 on my current system? Where would I get the gcc version from? Also, I get this message about the Linux kernel The current kernel version (2.6.37.6-0.20-desktop) is later than the version currently supported by this software (2.6.5) Is it possible to install this earlier kernel. Where would I get that from? Many thanks for any suggestions,

    Read the article

  • gcc sandboxing tool - AppArmor / CHROOT jail on Ubuntu 12.04

    - by StuR
    We have a Node application as the front end to a C++ sandboxing tool, which compiles code using gcc and outputs the result to the browser. e.g. exec("gcc -o /tmp/test /tmp/test.cpp", function (error, stdout, stderr) { if(!stderr) { execFile('/tmp/test', function(error, stdout, stderr) {}); } }); This works fine. However, as you can imagine this is a security nightmare if it were to be made public - so I was thinking of two options to protect my stack: 1) A CHROOT jail - but this in itself wouldn't be enough to prevent directory traversal / file access. 2) AppArmor ? So my question is really, how could I protect my stack from any nasties that could come from: A) Compiling unknown code using gcc B) Executing the compiled code

    Read the article

  • How to compile gcc-4.0 on Mountain Lion

    - by Frizlab
    So far I've successfully launched the configure, but when I type make, I get the following error, after some time (there's a lot which compile successfully): ld: unknown/unsupported architecture name for: -arch i686 /usr/bin/libtool: internal link edit command failed make[2]: *** [libgcc_s.dylib] Error 1 make[1]: *** [libgcc.a] Error 2 make: *** [all-gcc] Error 2 Is there a way to tell gcc not to compile itself for the i686 architecture? Here's my uname -a if it can help: Darwin Frizlabs-Computer.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 PS: I know gcc-4.0 is ancient, but I do need it.

    Read the article

  • Installing gcc on AIX 5.3

    - by A.Rashad
    we have a development AIX 5.3 on PowerPC CPU having the standard CC compiler. I downloaded the gcc 4.2.4, unpacked it and tried to install it seems there is something missing; untar takes around 15 minutes and ends with an error trying to create a directory starting with @ sign. and in the gcc folder itself, I can't find a configure or a Makefile to install any hint on how to do so?

    Read the article

  • How can I get gcc to write a file larger than 2.0 GB?

    - by fred.bear
    I wanted to recompile 'xxd' (written in C), so I installed CodeBlocks as the IDE. All seemed to go well unil I discovered that I couldn't write past the 2.0 GB barrier... I've read that 'gcc' needs to be recompiled... (That sounds a bit dramatic..) I've read that I can use 'fread64()' instead of 'fread()' ... (didn't work) I've read something about a compiler options (?)... but I get lost at that point? I am surprised that it didn't work out-of-the-box, as I thought the 2.0 GB limit was ancient history as far as defaults go ... wrong again?:( My OS is 32-bit, on 32-bit hardware. The gcc version report in as: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 Is there a simple way around this issue? PS.. I was fascinated by the WARNINGS: section of 'info xxd' (..only on Linux ;)

    Read the article

  • gcc: Do I need -D_REENTRANT with pthreads?

    - by stefanB
    On Linux (kernel 2.6.5) our build system calls gcc with -D_REENTRANT. Is this still required when using pthreads? How is it related to gcc -pthread option? I understand that I should use -pthread with pthreads, do I still need -D_REENTRANT? On a side note, is there any difference that you know off between the usage of REENTRANT between gcc 3.3.3 and gcc 4.x.x ? When I use -pthread gcc option I can see that _REENTRANT gets defined. Will omitting -D_REENTRANT from command line make any difference, for example could some objects be compiled without multithreaded support and then linked into binary that uses pthreads and will cause problems? I assume it should be ok just to use: g++ -pthread > echo | g++ -E -dM -c - > singlethreaded > echo | g++ -pthread -E -dM -c - > multithreaded > diff singlethreaded multithreaded 39a40 > #define _REENTRANT 1 We're compiling multiple static libraries and applications that link with the static libraries, both libraries and application use pthreads. I believe it was required at some stage in the past but want to know if it is still required. Googling hasn't returned any recent information mentioning -D_REENTRANT with pthreads. Could you point me to links or references discussing the use in recent version of kernel/gcc/pthread? Clarification: At the moment we're using -D_REENTRANT and -lpthread, I assume I can replace them with just g++ -pthread, looking at man gcc it sets the flags for both preprocessor and linker. Any thoughts?

    Read the article

  • Where does gcc keep its built-in include directory paths

    - by Charles
    GCC has built in include directories for certain standard headers. I just need to know where this list is. My newly compiled gcc will not compile my little test C++ program because it cannot find standard headers. I think it fails because of some config options I used to make my file system more organized. I set the bindir and libdir, which I think might have screwed up the built-in include paths for some reason. Program (dummy.c): #include <iostream> void main(){} Command: g++ dummy.c Error: dummy.c:1:20: fatal error: iostream: No such file or directory

    Read the article

  • GCC ABI compatibility

    - by Fredrik Ullner
    As far as I've understood, it is not possible to link libraries that use different versions of GCC's Application Binary Interface (ABI). Are there ABI changes to every version of GCC? Is it possible to link a library built with 4.3.1 if I use, say, GCC 4.3.2? Is there a matrix of some sort that lists all the ways I can combine GCC versions?

    Read the article

  • ICC vs GCC - Optimization and CPU architecture

    - by Rayne
    Hi all, I'm interested in knowing how GCC differs from Intel's ICC in terms of the optimization levels and catering to specific processor architecture. I'm using GCC 4.1.2 20070626 and ICC v11.1 for Linux. How does ICC's optimization levels (O1 to O3) differ from GCC, if they differ at all? The ICC is able to cater specifically to different architectures (IA-32, intel64 and IA-64). I've read that GCC has the -march compiler option which I think is similar, but I can't find a list of the options to use. I'm using Intel Xeon X5570, which is 64-bit. Are there any other GCC compiler options I could use that would cater my applications for 64-bit Intel CPUs? Thank you. Regards, Rayne

    Read the article

  • Legal uses of setjmp and GCC

    - by Chris Lutz
    Using GCC (4.0 for me), is this legal: if(__builtin_expect(setjmp(buf) != 0, 1)) { // handle error } else { // do action } I found a discussion saying it caused a problem for GCC back in 2003, but I would imagine that they would have fixed it by now. The C standard says that it's illegal to use setjmp unless it's one of four conditions, the relevant one being this: one operand of a relational or equality operator with the other operand an integer constant expression, with the resulting expression being the entire controlling expression of a selection or iteration statement; But if this is a GCC extension, can I guarantee that it will work under for GCC, since it's already nonstandard functionality? I tested it and it seemed to work, though I don't know how much testing I'd have to do to actually break it. (I'm hiding the call to __builtin_expect behind a macro, which is defined as a no-op for non-GCC, so it would be perfectly legal for other compilers.)

    Read the article

  • Make errors - can the gcc compiler warnings prevent a C file from being compiled into an object file

    - by Xolstice
    I'm trying to compile a wireless network card driver for my Linux box and I ran into a problem with the Make command. During the compilation process I normally see warnings on some of the C files that being are compiled; despite the warnings these files were still able to be compiled to an object file. When the Make process comes to a file called rtmp_wext.c however, the compiler generates a large number of warnings and then the whole Make process stops and returns an exit status of error 1, i.e. make: *** [rtmp_wext.o] Error 1. Usually I see an error with the C file for compilation to halt. This is the first time where it seems compiler warnings are preventing the file from being turned into an object file; is this possible or is something else the cause for the unsuccessful compilation?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >