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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
bazi
Posts: 7
Joined: Fri Mar 20, 2009 3:15 am
Location: Allgaeu (Germany, BW)

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

Post 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...
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

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

Post by salil_bhagurkar »

Try -ffreestanding :?
bazi
Posts: 7
Joined: Fri Mar 20, 2009 3:15 am
Location: Allgaeu (Germany, BW)

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

Post 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.
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

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

Post 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. :)
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

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

Post 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...
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
bazi
Posts: 7
Joined: Fri Mar 20, 2009 3:15 am
Location: Allgaeu (Germany, BW)

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

Post 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!
Post Reply