Page 1 of 1

Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 6:52 am
by bazi
At the Moment i get errors/warnings like this:

Code: Select all

mem.h:36: warning: conflicting types for built-in function 'memset'
I walked through the man pages of gcc and searched on the internet, but i only could find two answer. The first one is, to rename these functions, but i don't want to.
The second is, use of "-fno-builtin" or "--no-builtin" on my gcc-command line. But this doesn't work...

My gcc/binutils are compiled as described in your wiki. I have gcc 4.3.3 with binutils 2.16.
The whole command line for this file is:

Code: Select all

/usr/cross/bin/i586-elf-gcc -Wall -nostdlib -nostartfiles -nodefaultlibs -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin --no-builtin -c -o mem.o mem.c
I hope anyone of you knows a good solution...

Re: Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 7:56 am
by salil_bhagurkar
Try -ffreestanding :?

Re: Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 8:06 am
by bazi
Still the same...
I've used google and the search of this forum a lot, but couldn't find anything what helped...
Now i'll try to recompile the compiler and binutils.

Re: Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 10:03 am
by quok
bazi wrote:Still the same...
I've used google and the search of this forum a lot, but couldn't find anything what helped...
Now i'll try to recompile the compiler and binutils.
The argument you're looking for is -fno-builtin.

EDIT: Hmm, I see you're already using that... IIRC, -fno-builtin makes sure that GCC will not emit code for the built-ins, not that it won't make sure function declarations match. You may just want to fix your memset. :)

Re: Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 12:06 pm
by Troy Martin
I tthink if you put memset in an #ifdef memset #undefine memset .... #endif block (or something like that) it might work. Not too good at osdevving in C...

Re: Can't get rid of warnings about builtin-functions.

Posted: Sun Mar 22, 2009 2:16 pm
by Combuster
It says that your definition of memset doesn't match the expected definition. That means that the proper fix is to make your memset standards compliant.

Re: Can't get rid of warnings about builtin-functions.

Posted: Wed Mar 25, 2009 3:52 am
by bazi
It says that your definition of memset doesn't match the expected definition. That means that the proper fix is to make your memset standards compliant.
This works, thanks a lot!