Bug 8741 - include/asm-i386/page.h syntax causes 3rd-party compilation failure
Summary: include/asm-i386/page.h syntax causes 3rd-party compilation failure
Status: REJECTED INVALID
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-12 10:31 UTC by Timothy Stotts
Modified: 2007-07-12 11:13 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.22.x
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
fix page.h syntax to be more standard C (646 bytes, patch)
2007-07-12 10:32 UTC, Timothy Stotts
Details | Diff

Description Timothy Stotts 2007-07-12 10:31:04 UTC
Most recent kernel where this bug did not occur: 2.21.x
Distribution: Gentoo
Hardware Environment: 32-bit x86
Software Environment:
Problem Description:

3rd-party applications, such as VMware, may fail to compile again header file:
   include/asm-i386/page.h
for the sole reason of `page.h' using a very special GCC syntax rather than a more standard C syntax.

The methods in question are:
    static inline pte_t native_make_pte(unsigned long long val)
    static inline pte_t native_make_pte(unsigned long val)

They use a GCC extension for returning an anonymous struct with initial values.
It was probably written this way to emphasize the `inline' nature of the method.

Steps to reproduce:
    See the following bug for the only example I know of.
    https://bugs.gentoo.org/show_bug.cgi?id=182595

Note:
    This is more a recommendation as I anticipate it causing all sorts of bugs downstream. If you want to invalidate and recommend a different approach to this issue, please do so.
Comment 1 Timothy Stotts 2007-07-12 10:32:04 UTC
Created attachment 12016 [details]
fix page.h syntax to be more standard C
Comment 2 Andrew Morton 2007-07-12 10:40:19 UTC
Subject: Re: [Bugme-new]  New: include/asm-i386/page.h syntax
 causes 3rd-party compilation failure

On Thu, 12 Jul 2007 10:26:14 -0700 (PDT)
bugme-daemon@bugzilla.kernel.org wrote:

> 3rd-party applications, such as VMware, may fail to compile again header
> file:
>    include/asm-i386/page.h
> for the sole reason of `page.h' using a very special GCC syntax rather than a
> more standard C syntax.
> 
> The methods in question are:
>     static inline pte_t native_make_pte(unsigned long long val)
>     static inline pte_t native_make_pte(unsigned long val)

Those applications should not be defining __KERNEL__, hence they should
not be encountering this code.

If the _are_ defining __KERNEL__, well, thwy should be prepared to handle
kernel code.
Comment 3 Timothy Stotts 2007-07-12 10:48:25 UTC
Sorry. I was not explict. They are kernel modules, so I assume they define __KERNEL__. Thanks.
Comment 4 Adrian Bunk 2007-07-12 11:13:14 UTC
The kernel uses a superset of C, and compiling the kernel and modules with compilers that are not gcc compatible is not supported.

Note You need to log in before you can comment on or make changes to this bug.