Re: Compile errors when including linux/byteorder/swab.h

Fare Rideau (rideau@ens.fr)
Thu, 30 Apr 1998 17:07:45 +0200 (CEST)


[This is a public reply to a "bug" report about my byteorder patch;
original report below, for linux-kernel people]

Dear Holger,
I'm sorry about your compile warnings, and I'm aware of the problem
(got a mail similar to yours earlier), but know no satisfactory solution.
You can safely ignore them; everything should work fine if compiled
with gcc using optimization.

The fact is the linux kernel uses many extern inline assembly routines,
and gcc's -Wstrict-prototypes -Wmissing-prototypes hates them.

I'd say yours is a gcc problem, that requires prototypes even for
inline functions (I don't even know if it accepts such prototypes).
Linus would say that the fault is libc people's,
who shouldn't be including kernel headers to begin with.

If gcc accepts prototypes for extern inline routines,
feel free to add such prototypes to all kernel header files,
and contribute a patch to linux-kernel@vger.rutgers.edu
mailing list as well as torvalds@transmeta.com.
If not, fix gcc and/or glibc.

As for the long-long integer constant,
I know no satisfactory way to portably ensure that a C constant
will be 64 bits, and didn't want to create yet another set of include files
just so as to achieve that. Again, feel free to come with a clever patch.
The long long trick works with gcc, anyway, and might even get in
next C standard, I was told...

PS to linux-kernel people: loosely related issue.
What's the "right" way to portably define and access
unaligned 64-bit values so that the same code
with run on all Linux architectures?

PPS to the same: I'm not on the list, so please cc: me any replies.

## 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 ##
Reisner's Rule of Conceptual Inertia:
If you think big enough, you'll never have to do it.

------>8------>8------>8------>8------>8------>8------>8------>8------>8------
> Hello,
>
> When including netinet/in.h which in turn includes linux/byteorder/swab.h
> and I have the compile options -pedantic-errors -Wstrict-prototypes -Wmissing-prototypes
> enabled I get the following errors/warning:
>
> In file included from /usr/include/linux/byteorder/little_endian.h:11,
> from /usr/include/asm/byteorder.h:45,
> from /usr/include/linux/in.h:173,
> from /usr/include/netinet/in.h:79,
> from ftpcmd.c:110:
> /usr/include/linux/byteorder/swab.h:97: warning: no previous prototype for `__fswab16'
> /usr/include/linux/byteorder/swab.h:101: warning: no previous prototype for `__swab16p'
> /usr/include/linux/byteorder/swab.h:105: warning: no previous prototype for `__swab16s'
> /usr/include/linux/byteorder/swab.h:110: warning: no previous prototype for `__fswab32'
> /usr/include/linux/byteorder/swab.h:114: warning: no previous prototype for `__swab32p'
> /usr/include/linux/byteorder/swab.h:118: warning: no previous prototype for `__swab32s'
> /usr/include/linux/byteorder/swab.h:124: warning: no previous prototype for `__fswab64'
> /usr/include/linux/byteorder/swab.h: In function `__fswab64':
> /usr/include/linux/byteorder/swab.h:127: ANSI C forbids long long integer constants
> /usr/include/linux/byteorder/swab.h: At top level:
> /usr/include/linux/byteorder/swab.h:134: warning: no previous prototype for `__swab64p'
> /usr/include/linux/byteorder/swab.h:138: warning: no previous prototype for `__swab64s
>
> I apologise if you are not the right person to send this to.
>
> Holger
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu