Bug 67269 - kscd: plat_linux.c: error with "inline" keyword in Linux header file
Summary: kscd: plat_linux.c: error with "inline" keyword in Linux header file
Status: RESOLVED FIXED
Alias: None
Product: kscd
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-05 07:58 UTC by Daniel Richard G.
Modified: 2003-12-21 20:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2003-11-05 07:58:41 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.2 (Debian)
OS:          Linux

Compiling plat_linux.c with GCC gives the following error:

    In file included from /usr/include/linux/cdrom.h:14,
                     from plat_linux.c:84:
    /usr/include/asm/byteorder.h:38: error: syntax error before "__u64"

The line in question from byteorder.h:

    static inline __u64 ___arch__swab64(__u64 val)

Problem: plat_linux.c is compiled with -ansi; ANSI mode disables the "inline" keyword (although the same functionality is still available via "__inline__"); plat_linux.c has the misfortune of pulling in a broken kernel header file that uses "inline" instead of "__inline__". (The header still has this bug as of kernel 2.4.22.)

Solution 1: Fix byteorder.h.

Solution 2: Add AC_C_INLINE to kdemultimedia's configure.in.in, so to make "inline" work as usual.
Comment 1 Stephan Kulow 2003-11-05 09:14:55 UTC
Subject: kdemultimedia/kscd/libwm

CVS commit by coolo: 

kernel headers suck ;(
still compiles for me and should fix broken systems
CCMAIL: 67269-done@bugs.kde.org


  M +3 -1      plat_linux.c   1.30


--- kdemultimedia/kscd/libwm/plat_linux.c  #1.29:1.30
@@ -81,7 +81,9 @@ typedef unsigned long long __u64; 
 /* needed for non-ansi kernel headers */
 #define asm __asm__
+#define inline __inline__
 #include <asm/types.h>
 #include <linux/cdrom.h>
 #undef asm
+#undef inline
 
 #include "include/wm_cdda.h"


Comment 2 Daniel Richard G. 2003-11-05 09:49:33 UTC
Confirmed successful compilation of plat_linux.c in the CVS tree. My hat goes off to you, Mr. Kulow :)
Comment 3 Ingo Oeser 2003-12-21 11:36:51 UTC
Kernel Headers should not be included in user space. These are the glibc copies of kernel headers. Please complain to the glibc maintainers, since
they keep a hand-crafted copy of current kernel headers adjusted to their needs around.
Comment 4 Daniel Richard G. 2003-12-21 13:00:53 UTC
Well, I sent a patch to linux-kernel + Linus + Marcelo; it should hopefully propagate from there, though one can never overestimate how busy all three of them are....
Comment 5 Thiago Macieira 2003-12-21 20:24:14 UTC
You did read the last comment, didn't you? Especially the part that says "please complain to the glibc maintainers".