Prototypes for extern inline functions??? (was: swab.h)

Francois-Rene Rideau (I+fare+WANT@tunes.NO.org.SPAM)
15 Sep 1998 22:57:44 +0200


dmircea@kappa.ro (Mircea Damian) writes:
> I do remember that something was discussed on the list about swab.h but
> didn't payed to much attention to it.

> I was building telnetd from netkit-telnet-0.12 when I observed a lot of
> warnings coming from swab.h:
> /usr/include/linux/byteorder/swab.h:100: warning: no previous prototype for
> `__fswab16'
> ... etc.
> I think is better to place a function prototype for each at line 75..
> something like this: [snip]
> Am I right or I miss something?

Dear Mircea,

Below is an excerpt of an earlier reply I made to a report for the same "bug".
Of course, the final decision rests in the hands of one of
Linus, glibc, and gcc/egcs maintainers. If you really think the "bug"
is in Linux, then it's not just swab.h, but the whole kernel,
that should be annotated with prototypes...

## Faré | VN: Уng-Vû Bân | Join the TUNES project! http://www.tunes.org/ ##
## FR: François-René Rideau | TUNES is a Useful, Not Expedient System ##
## Reflection&Cybernethics | Project for a Free Reflective Computing System ##
A fruitful discussion is a negociation, out of which emerges meaning. Classic
works are Standards, and politeness is a protocol, to ease such negociation.
------>8------>8------>8------>8------>8------>8------>8------>8------>8------
The function is meant to be defined once, which is correct.
Those warnings are benign.

It looks like the use of -Wstrict-prototypes -Wmissing-prototypes
makes gcc complain because I don't have a prototype
for a few private *extern inline* functions,
which requirement looks silly to me:
why care for a prototype for a function
when you have the very inline function definition just at hand???
I don't think any asm/*.h file has prototypes for extern inline functions!

To conclude, this might be considered as a bug from gcc and/or from the libc,
that needn't include kernel headers, to begin with.
If you consider it as a kernel bug, feel free to patch the kernel,
by adding prototypes to *all* extern inline functions in .h files
(and not just the ones in include/linux/byteorder/).
------>8------>8------>8------>8------>8------>8------>8------>8------>8------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/