On 15/08/11 10:28, aliko wrote: > I've got a strange error messages if using -O0 optimization level or not > using optimization at all. > The messages are about undefined references to memcpy and memset > functions. But if I set optimization level to -O1 or above they are > disapear. >
When you enable optimisation, the compiler will replace calls to some standard library functions (including memcpy and memset) with inlined code if it thinks it is better (smaller and/or faster) than calling the library version. Typically, if the call has a fixed size (as many memcpy and memset calls do) then the compiler can generate a nice tight loop instead of a function call. With optimisations disabled, or when the built-in function optimisation is specifically disabled, the compiler will generate a call to the library function. It is then up to the linker to link in the correct code from the library. So it looks like in this case you are not getting the C library included correctly in the linking phase, since gcc is unable to find the library functions that are needed when optimisation is disabled. It is almost certainly a good idea to figure out the library/linking problem. But equally, it is a good idea to use at least -O1 when compiling - running a compiler with optimisations disabled is like driving your car in first gear all the time. ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Mspgcc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mspgcc-users
