Search Results

Search found 2237 results on 90 pages for 'msp430 gcc'.

Page 11/90 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Intel Core 2, Core i7 Optimizations For GCC 4.6

    <b>Phoronix:</b> "CodeSourcery, a company that works on GCC for various companies like with Texas Instruments for bringing the GNU Toolchain to new CPUs and also offers their own software development environment, has shared their intentions to provide a new set of GCC optimizations for Intel's Core 2 and Core i7 processors."

    Read the article

  • How to ensure structures are completly initialized (by name) in GCC?

    - by Steven Spark
    How do I ensure each and every field of my structures are initialized in GCC when using designated initializers? (I'm especially interested in function pointers.) (I'm using C not C++.) Here is an example: typedef struct { int a; int b; } foo_t; typedef struct { void (*Start)(void); void (*Stop)(void); } bar_t; foo_t fooo = { 5 }; foo_t food = { .b=4 }; bar_t baro = { NULL }; bar_t bard = { .Start = NULL }; -Wmissing-field-initializers does not help at all. It works for fooo only in GCC (mingw 4.7.3, 4.8.1), and clang does only marginally better (no warnings for food and bard). I'm sure there is a reason for not producing warnings for designated initializer (even when I explicitly ask for them) but I want/need them. I do not want to initialize structures based on order/position because that is more error prone (for example swapping Start and Stop won't even give any warning). And neither gcc nor clang will give any warning that I failed to explicitly initialize a field (when initializing by name). I also don't want to litter my code with if(x.y==NULL) lines for multiple reasons, one of which is I want compile time warnings and not runtime errors. At least splint will give me warnings on all 4 cases, but unfortunately I cannot use splint all the time (it chokes on some of the code (fails to parse some C99, GCC extensions)). Note: If I'm using a real function instead of NULL GCC will also show a warning for baro (but not bard). I searched google and stack overflow but only found related questions and have not found answer for this specific problem. The best match I have found is 'Ensure that all elements in a structure are initialized' Ensure that all elements in a structure are initialized Which asks pretty much the same question, but has no satisfying answer. Is there a better way dealing with this that I have not mentioned? (Maybe other code analysis tool? Preferably something (free) that can be integrated into Eclipse or Visual Studio...)

    Read the article

  • Changing default compiler in Linux, using SCons

    - by ereOn
    On my Linux platform, I have several versions of gcc. Under usr/bin I have: gcc34 gcc44 gcc Here are some outputs: $ gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) $ gcc44 --version gcc44 (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6) I need to use the 4.4 version of gcc however the default seems to the 4.1 one. I there a way to replace /usr/bin/gcc and make gcc44 the default compiler not using a symlink to /usr/bin/gcc44 ? The reason why I can't use a symlink is because my code will have to be shipped in a RPM package using mock. mock creates a minimal linux installation from scratch and just install the specified dependencies before compiling my code in it. I cannot customize this "minimal installation". Ideally, the perfect solution would be to install an official RPM package that replaces gcc with gcc44 as the default compiler. Is there such a package ? Is this even possible/good ? Additional information I have to use SCons (a make alternative) and it doesn't let me specify the binary to use for gcc. I will also accept any answer that will tell me how to specify the gcc binary in my SConstruct file.

    Read the article

  • Why doesn't gcc remove this check of a non-volatile variable?

    - by Thomas
    This question is mostly academic. I ask out of curiosity, not because this poses an actual problem for me. Consider the following incorrect C program. #include <signal.h> #include <stdio.h> static int running = 1; void handler(int u) { running = 0; } int main() { signal(SIGTERM, handler); while (running) ; printf("Bye!\n"); return 0; } This program is incorrect because the handler interrupts the program flow, so running can be modified at any time and should therefore be declared volatile. But let's say the programmer forgot that. gcc 4.3.3, with the -O3 flag, compiles the loop body (after one initial check of the running flag) down to the infinite loop .L7: jmp .L7 which was to be expected. Now we put something trivial inside the while loop, like: while (running) putchar('.'); And suddenly, gcc does not optimize the loop condition anymore! The loop body's assembly now looks like this (again at -O3): .L7: movq stdout(%rip), %rsi movl $46, %edi call _IO_putc movl running(%rip), %eax testl %eax, %eax jne .L7 We see that running is re-loaded from memory each time through the loop; it is not even cached in a register. Apparently gcc now thinks that the value of running could have changed. So why does gcc suddenly decide that it needs to re-check the value of running in this case?

    Read the article

  • What -W values in gcc correspond to which actual warnings?

    - by SebastianK
    Preamble: I know, disabling warnings is not a good idea. Anyway, I have a technical question about this. Using GCC 3.3.6, I get the following warning: choosing ... over ... because conversion sequence for the argument is better. Now, I want to disable this warning as described in gcc warning options by providing an argument like -Wno-theNameOfTheWarning But I don't know the name of the warning. How can I find out the name of the option that disables this warning? I am not able to fix the warning, because it occurs in a header of an external library that can not be changed. It is in boost serialization (rx(s, count)): template<class Archive, class Container, class InputFunction, class R> inline void load_collection(Archive & ar, Container &s) { s.clear(); // retrieve number of elements collection_size_type count; unsigned int item_version; ar >> BOOST_SERIALIZATION_NVP(count); if(3 < ar.get_library_version()) ar >> BOOST_SERIALIZATION_NVP(item_version); else item_version = 0; R rx; rx(s, count); std::size_t c = count; InputFunction ifunc; while(c-- > 0){ ifunc(ar, s, item_version); } } I have already tried #pragma GCC system_header but this had no effect. Using -isystem instead of -I also does not work. The general question remains is: I know the text of the warning message. But I do not know the correlation to the gcc warning options.

    Read the article

  • Ubuntu: What gcc to use when crosscompiling for the STM32 (Cortex-M3)?

    - by Johan
    Hi I'm trying to get started with the STM32 (Cortex-M3) and my plan is get this working from Ubuntu (9.04 / AMD64). To start with I got the Olimex stm32-h103 header board and the Olimex ARM-USB-OCD jtag, and on to of that I will probably use OpenOCD, gcc and Eclipse. But right now I'm looking into what version of gcc to use and how to setup that to be able to crosscompile the code. There seem to be some arm projects out there but I don't know what to start with, can somebody push me in the right direction? Thanks Johan Update: There seems almost to be what I want from codesourcery, but they seem to focus on IA32 and not AMD64. However in the supported devices I find the Cortex-M3 ARM EABI, ARM M-profile Simulator -mcpu=cortex-m3 -mthumb Update: There is a possibility to install IA32 on AMD64, so maybe the marked answer is obsolete already. Update: Found this link about crosscompile for the Cortex-M3. http://www.eluaproject.net/en_tc_cortex.html http://fanplastic.org/gcc-for-arm-eabi/

    Read the article

  • What configure options were used when building gcc / libstdc++?

    - by OK
    After reading about the problem of passing empty std::string objects between DLLs and EXEs, I am concerned about the configure options used to build my gcc / libstdc++. More specific I want to know if --enable-fully-dynamic-string was used during ./configure. I'm using MinGW 4.4.0 on Windows XP. Does anybody know the configuration used to build this release? Is there a general way to find this information for any installation of GNU gcc? The gcc manual gives me no hint on this topic. Thanks for your input!

    Read the article

  • Using GCC 4.2 to compile *.mm files is very very slow, but LLVM has done a very good job, any difference?

    - by jianhua
    My project is obj-c and C++ hybirid, filled with by both *.m and *.mm. When compiling, if choose GCC 4.2, *.m obj-c source files compile speed is very fast but *.mm very very slow, but LLVM 2.0 can do a very good job, it is very fast for both *.m and *.mm. My question: Is there any difference between LLVM and GCC 4.2 during compliling *.mm files? why GCC 3.2 is so slow? Any ieda or discussion will be appreciated, thanks in advance. ENV: XCODE 4.0.1

    Read the article

  • why i failed to build vsftp?

    - by hugemeow
    make, then failed with the following message. the main point is /lib/libcap.so.1: could not read symbols: File in wrong format, confusing... gcc -c readwrite.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c opts.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c ssl.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c sslslave.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c ptracesandbox.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c ftppolicy.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c sysutil.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -c sysdeputil.c -O2 -Wall -W -Wshadow -idirafter dummyinc gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o -Wl,-s `./vsf_findlibs.sh` /lib/libcap.so.1: could not read symbols: File in wrong format collect2: ld returned 1 exit status make: *** [vsftpd] Error 1 [mirror@hugemeow vsftpd]$ ls /lib/libc libc-2.5.so libcap.so.1.10 libcidn.so.1 libcom_err.so.2.1 libcrypto.so.0.9.8e libcrypt.so.1 libcap.so.1 libcidn-2.5.so libcom_err.so.2 libcrypt-2.5.so libcrypto.so.6 libc.so.6 [mirror@hugemeow vsftpd]$ ls /lib/libc libc-2.5.so libcap.so.1.10 libcidn.so.1 libcom_err.so.2.1 libcrypto.so.0.9.8e libcrypt.so.1 libcap.so.1 libcidn-2.5.so libcom_err.so.2 libcrypt-2.5.so libcrypto.so.6 libc.so.6 [mirror@hugemeow vsftpd]$ ls /lib/libcap.so.1 -l lrwxrwxrwx 1 root root 14 Mar 20 2012 /lib/libcap.so.1 -> libcap.so.1.10 [mirror@hugemeow vsftpd]$ ls /lib/libcap.so.1 -lh lrwxrwxrwx 1 root root 14 Mar 20 2012 /lib/libcap.so.1 -> libcap.so.1.10 [mirror@hugemeow vsftpd]$ ls /lib/libcap.so.1 -lhL -rwxr-xr-x 1 root root 12K Mar 15 2007 /lib/libcap.so.1 this may have something to do with 64 bit system, but i have make modification to vsf_findlibs.sh 48 # Look for libcap (capabilities) 49 if locate_library /lib64/libcap.so.1; then 50 echo "/lib/libcap.so.1"; 51 elif locate_library /lib64/libcap.so.2; then 52 echo "/lib/libcap.so.2"; 53 else 54 # locate_library /usr/lib/libcap.so && echo "-lcap"; 55 # locate_library /lib/libcap.so && echo "-lcap"; 56 locate_library /lib64/libcap.so.1 && echo "-lcap"; 57 fi but make failed with the same error, why?

    Read the article

  • Installing gtk and compiling using gcc under windows? [solved]

    - by sil3nt
    I have gcc installed in c:/programfiles (also set as a path variable), and i have all the necessary files for gtk from http://www.gtk.org/download-windows.html, glib,gtk,pango,atk and cairo. Although I have no clue as to how to compile a c program using gtk with the gcc compiler. How do I set everything up so that it works?. (I don't know where each zip file goes.?) basically I don't really know where start.

    Read the article

  • GCC how to block system calls within a program?

    - by CMPITG
    Does anyone tell me how to block system calls within a program, please? I am building a system which takes a piece of C source code, compiles it with gcc and runs it. For security reasons, I need to prevent the compiled program from calling system calls. Is there any way to do it, from the source code level (e.g. stripping the header files of gcc, detecting malicious external calls, ...) to the executable level?

    Read the article

  • Is there any way to make gcc print offending lines when it emits an error?

    - by Alex
    I have a large codebase that I've been tasked with porting to 64 bits. The code compiles, but it prints a very large amount of incompatible pointer warnings (as is to be expected.) Is there any way I can have gcc print the line on which the error occurs? At this point I'm just using gcc's error messages to try to track down assumptions that need to be modified, and having to look up every one is not fun.

    Read the article

  • Installing gcc in Ubuntu 11.10

    - by Chi-Ping Lee
    I want to install gcc on my computer. To do this, I ran the following command: sudo apt-get install build-essential As this runs, it connects (or tries to connect) to the server tw.archive.ubuntu.com. But the server is not working. How can I fix this and get gcc installed? Note: the Taiwan mirror is down as of 2012-06-01 0352. See thread here. This pastebin contains the text of /etc/apt/sources.list, after changing from tw.archive.ubuntu.com to the main server.

    Read the article

  • My yum repository able to search packages, but not able to install it in RHEL?

    - by mandy
    I set up yum from dvd. Following is the containts of my .repo file: [dvd] name=Red Hat Enterprise Linux Installation DVD baseurl=file:///media/dvd enabled=0. I'm able to search packages. However while installation I'm getting below error: [root@localhost dvd]# yum install libstdc++.x86_64 Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Nothing to do My Yum Search output: [root@localhost dvd]# yum search gcc Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. ============================================================================= Matched: gcc ============================================================================= compat-libgcc-296.i386 : Compatibility 2.96-RH libgcc library compat-libstdc++-296.i386 : Compatibility 2.96-RH standard C++ libraries compat-libstdc++-33.i386 : Compatibility standard C++ libraries compat-libstdc++-33.x86_64 : Compatibility standard C++ libraries cpp.x86_64 : The C Preprocessor. libgcc.i386 : GCC version 4.1 shared support library libgcc.x86_64 : GCC version 4.1 shared support library libgcj.i386 : Java runtime library for gcc libgcj.x86_64 : Java runtime library for gcc libstdc++.i386 : GNU Standard C++ Library libstdc++.x86_64 : GNU Standard C++ Library libtermcap.i386 : A basic system library for accessing the termcap database. libtermcap.x86_64 : A basic system library for accessing the termcap database. Please guide me on this, I want to install gcc on my RHEL.

    Read the article

  • Why did this work with Visual C++, but not with gcc?

    - by Carlos Nunez
    I've been working on a senior project for the last several months now, and a major sticking point in our team's development process has been dealing wtih rifts between Visual-C++ and gcc. (Yes, I know we all should have had the same development environment.) Things are about finished up at this point, but I ran into a moderate bug just today that had me wondering whether Visual-C++ is easier on newbies (like me) by design. In one of my headers, there is a function that relies on strtok to chop up a string, do some comparisons and return a string with a similar format. It works a little something like the following: int main() { string a, b, c; //Do stuff with a and b. c = get_string(a,b); } string get_string(string a, string b) { const char * a_ch, b_ch; a_ch = strtok(a.c_str(),","); b_ch = strtok(b.c_str(),","); } strtok is infamous for being great at tokenizing, but equally great at destroying the original string to be tokenized. Thus, when I compiled this with gcc and tried to do anything with a or b, I got unexpected behavior, since the separator used was completely removed in the string. Here's an example in case I'm unclear; if I set a = "Jim,Bob,Mary" and b="Grace,Soo,Hyun", they would be defined as a="JimBobMary" and b="GraceSooHyun" instead of staying the same like I wanted. However, when I compiled this under Visual C++, I got back the original strings and the program executed fine. I tried dynamically allocating memory to the strings and copying them the "standard" way, but the only way that worked was using malloc() and free(), which I hear is discouraged in C++. While I'm curious about that, the real question I have is this: Why did the program work when compiled in VC++, but not with gcc? (This is one of many conflicts that I experienced while trying to make the code cross-platform.) Thanks in advance! -Carlos Nunez

    Read the article

  • Can I cross compile with gcc for an old version of a Linux distro on my Ubuntu 9.10?

    - by Johan
    Hi, I have some old hardware with an old version of say SuSE linux running on it. Now I have this fancy development machine running Ubuntu 9.10. Some of the tools I use to compile my C app (written in Python 2.6.x) are not available on the old SuSe box. So... is it possible to compile for that old machine on my dev box? I have the following steps in mind, but would like to cross-check before venturing off into this quest: 1. Find out which static/shared libs my app needs and find/build target version of them 2. Also find the corresponding header files 3. Feed the correct flags to gcc to use the target headers and libraries 4. Feed the correct flags to gcc to use the correct architecture (i386/i686), or do I need a cross-compilation toolchain. 5. Compile, upload and enjoy ;-) I regularly use avr-gcc and cc65, both are cross compiling. I know that you set up a coss compiler for developing something like a gumstix, so it should be possible to do the same for old/other Linux distros, not? C

    Read the article

  • Beginner problem / error with ansi-c and gcc under ubuntu.

    - by Framester
    Hi, I am just starting programming ansi c with gcc under ubuntu (9.04). I get following error messages: error messages: main.c:6: error: expected identifier or ‘(’ before ‘/’ token In file included from /usr/include/stdio.h:75, from main.c:9: /usr/include/libio.h:332: error: expected specifier-qualifier-list before ‘size_t’ /usr/include/libio.h:364: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/libio.h:373: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/libio.h:493: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’ In file included from main.c:9: /usr/include/stdio.h:314: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/stdio.h:682: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’ /usr/include/stdio.h:688: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’ main.c:12: error: expected identifier or ‘(’ before ‘/’ token I assume it is a very simple problem, maybe in the configuration of ubuntu or gcc. I am new to programming under linux as well. I googled for help and went through a tutorial but could not find an answer. Thank you! code: #include <stdio.h> #include <math.h> int main() { printf("TestOutput\n"); return (0); } command: ~/Documents/projects/Trials$ gcc -Wall -ansi main.c

    Read the article

  • GCC error with variadic templates: "Sorry, unimplemented: cannot expand 'Identifier...' into a fixe

    - by Dennis
    While doing variadic template programming in C++0x on GCC, once in a while I get an error that says "Sorry, unimplemented: cannot expand 'Identifier...' into a fixed-length arugment list." If I remove the "..." in the code then I get a different error: "error: parameter packs not expanded with '...'". So if I have the "..." in, GCC calls that an error, and if I take the "..." out, GCC calls that an error too. The only way I have been able to deal with this is to completely rewrite the template metaprogram from scratch using a different approach, and (with luck) I eventually come up with code that doesn't cause the error. But I would really like to know what I was doing wrong. Despite Googling for it and despite much experimentation, I can't pin down what it is that I'm doing differently between variadic template code that does produce this error, and code that does not have the error. The wording of the error message seems to imply that the code should work according the C++0x standard, but that GCC doesn't support it yet. Or perhaps it is a compiler bug? Here's some code that produces the error. Note: I don't need you to write a correct implementation for me, but rather just to point out what is about my code that is causing this specific error // Used as a container for a set of types. template <typename... Types> struct TypePack { // Given a TypePack<T1, T2, T3> and T=T4, returns TypePack<T1, T2, T3, T4> template <typename T> struct Add { typedef TypePack<Types..., T> type; }; }; // Takes the set (First, Others...) and, while N > 0, adds (First) to TPack. // TPack is a TypePack containing between 0 and N-1 types. template <int N, typename TPack, typename First, typename... Others> struct TypePackFirstN { // sorry, unimplemented: cannot expand ‘Others ...’ into a fixed-length argument list typedef typename TypePackFirstN<N-1, typename TPack::template Add<First>::type, Others...>::type type; }; // The stop condition for TypePackFirstN: when N is 0, return the TypePack that has been built up. template <typename TPack, typename... Others> struct TypePackFirstN<0, TPack, Others...> //sorry, unimplemented: cannot expand ‘Others ...’ into a fixed-length argument list { typedef TPack type; }; EDIT: I've noticed that while a partial template instantiation that looks like does incur the error: template <typename... T> struct SomeStruct<1, 2, 3, T...> {}; Rewriting it as this does not produce an error: template <typename... T> struct SomeStruct<1, 2, 3, TypePack<T...>> {}; It seems that you can declare parameters to partial specializations to be variadic; i.e. this line is OK: template <typename... T> But you cannot actually use those parameter packs in the specialization, i.e. this part is not OK: SomeStruct<1, 2, 3, T... The fact that you can make it work if you wrap the pack in some other type, i.e. like this: SomeStruct<1, 2, 3, TypePack<T...>> to me implies that the declaration of the variadic parameter to a partial template specialization was successful, and you just can't use it directly. Can anyone confirm this?

    Read the article

  • why gcc 4.x default reserve 8 bytes for stack on linux when calling a method?

    - by nikcname
    as a beginner of asm, I am checking gcc -S generated asm code to learn. why gcc 4.x default reserve 8 bytes for stack when calling a method? func18 is the empty function with no return no param no local var defined. I can't figure out why 8 bytes is reserved here (neither any forum/site mention for the reason, ppl seems take it for granted) is it for the %ebp just push? or return type?! many thx! .globl _func18 _func18: pushl %ebp movl %esp, %ebp subl $8, %esp .text

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >