gcc parameter

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
ich_will

gcc parameter

Post by ich_will »

If I compile my Kernel gcc prints out some warnings like this:

In file included from string.h:1,
from strcat.c:1:
strcmp.h:1: warning: conflicting types for built-in function `strcmp'
.
.
.

How can I scotch this messages? Or how can I make gcc don't use the build in string functions
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:gcc parameter

Post by Solar »

ich_will wrote: How can I scotch this messages?
Never disable warnings. They point to a problem - solve the problem, not the diagnostics. To the contrary - always see to it that every possible diagnostic is printed. Personally, I also activate -Werror, which handles every warning as a "hard" error.
Or how can I make gcc don't use the build in string functions
--no-builtin...
Every good solution is obvious once you've found it.
ich_will

Re:gcc parameter

Post by ich_will »

thanks
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:gcc parameter

Post by Pype.Clicker »

however, i strongly suggest you get a look at the function's definition (as it's a standard function) and comply with the standard ... or pick up a non-standard name for your non-standard function.

<rant>
When people see "strcpy()" they think 'a function that will copy chars from its second argument into its first arguments, both being char* and returns ... etc.' If you have an implementation that use the opposite order, you'll fool everyone including yourself in the future :)
</rant>
ich_will

Re:gcc parameter

Post by ich_will »

I try to keep all like the original functions.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:gcc parameter

Post by Neo »

Solar wrote: --no-builtin...
r u sure i use
-fno-builtin
and it works for me. Anyway let me check...... Ok i guess
--no-builtin
works too. Any idea why the gave 2 ways to do the same thing.
Only Human
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:gcc parameter

Post by Solar »

A common illness among the GNU people. ;-)
Every good solution is obvious once you've found it.
Post Reply