Page 1 of 1

gcc parameter

Posted: Mon Apr 05, 2004 6:53 am
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

Re:gcc parameter

Posted: Mon Apr 05, 2004 7:19 am
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...

Re:gcc parameter

Posted: Mon Apr 05, 2004 8:09 am
by ich_will
thanks

Re:gcc parameter

Posted: Mon Apr 05, 2004 8:24 am
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>

Re:gcc parameter

Posted: Mon Apr 05, 2004 10:33 am
by ich_will
I try to keep all like the original functions.

Re:gcc parameter

Posted: Mon Apr 05, 2004 12:27 pm
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.

Re:gcc parameter

Posted: Tue Apr 06, 2004 12:55 am
by Solar
A common illness among the GNU people. ;-)